ajuda em javascript popup

vx3000

Membro
boa tarde. gostaria de por um problema que tenho numa popup que estou a tentar implementar num site. passa se que a popup tem um tempo de estar aberta e volta a fechar se. gostaria de retirar isso.se alguem me poder ajudar... o codigo que tenho e o seguinte.
<html>
<title></title>

<style type="text/css">
#popup{
position: absolute;
top: 30%;
left: 30%;
width: 300px;
height: 150px;
padding: 20px 20px 20px 20px;
border-width: 2px;
border-style: solid;
background: #CCCCCC;
display: none;
}
.style1 { font-family: "Times New Roman", Times, serif; font-size: 12px; font-weight: bold;}
.style2 { font-family: "Times New Roman", Times, serif; font-size: 11px;}
</style>
<!--<body onload="javascript: abrir()">-->

<script language="javascript" type="">
function fechar(){
document.getElementById('popup').style.display = 'none';
}
function abrir(){
document.getElementById('popup').style.display = 'block';
setTimeout ("fechar()", 4000);
}
</script>

<DIV id="popup">
<table border="1">
<tr><td><div align="right"><small><a href="javascript: fechar();">[X]</a></small></div>
Enviar senha:</td></tr>
<tr><td>Digite o seu E-mail:<input type="text" size="15" /></td></tr></table>
</DIV>
<br /> <a href="javascript: abrir();">Abrir POPUP</a>

</body>
</html>

cumps.
 
Boas,

Código:
<html>
<title></title>
 
<style type="text/css">
#popup{
position: absolute;
top: 30%;
left: 30%;
width: 300px;
height: 150px;
padding: 20px 20px 20px 20px;
border-width: 2px;
border-style: solid;
background: #CCCCCC;
display: none;
}
.style1 { font-family: "Times New Roman", Times, serif; font-size: 12px; font-weight: bold;}
.style2 { font-family: "Times New Roman", Times, serif; font-size: 11px;}
</style>
<!--<body onload="javascript: abrir()">-->
 
<script language="javascript" type="">
function fechar(){
document.getElementById('popup').style.display = 'none';
}
function abrir(){
document.getElementById('popup').style.display = 'block';
[COLOR=red]//[/COLOR]setTimeout ("fechar()", 4000);
}
</script>
 
<DIV id="popup"> 
<table border="1">
<tr><td><div align="right"><small><a href="javascript: fechar();">[X]</a></small></div>
Enviar senha:</td></tr>
<tr><td>Digite o seu E-mail:<input type="text" size="15" /></td></tr></table>
</DIV>
<br /> <a href="javascript: abrir();">Mostrar</a> [COLOR=red]<a href="javascript: fechar();">Ocultar</a>[/COLOR]
 
</body>
</html>
 
Última edição:
Back
Topo