Como fazer botao FECHAR

1,024 views
Skip to first unread message

Jean Nascimento

unread,
May 11, 2007, 2:15:38 PM5/11/07
to jque...@googlegroups.com
Seguinte moçada nao estou conseguindo fazer o jQuery fexar uma janela,
alguem sabe como proceder? tentei com document.close() e
window.close() e nd
e eu tenho q fechar mesmo, não é pa sumir com div ehhehe

$("#fechar")
.click(function(){
window.close();//ou document.close
})
.mouseout(function(){
MM_swapImgRestore();
})
.mouseover(function(){
MM_swapImage('fechar','','../imgs/botao_fechar_over.png',1)
})


o esquema de swapImage ta susse mas preciso saber qual o metodo
correto para botar no click

eu tb utilizo esse mesmo metodo em paginas q eu soh chamo pelo div ae
fica susse dar um hide() =p
--

[]´s Jean
www.suissa.info

Ethereal Agency
www.etherealagency.com

Giovanni Donda - Gmail

unread,
May 11, 2007, 2:20:38 PM5/11/07
to jque...@googlegroups.com
tenta isso

$("#fechar").bind("click",function(){
window.close();

// se for uma janela pop up criada com algum nome usa
// popup.close();

});

abraços,
Giovanni

Jean Nascimento escreveu:

Jean Nascimento

unread,
May 11, 2007, 2:25:24 PM5/11/07
to jque...@googlegroups.com
Naum deu tb veiii, o problema ta mesmo no metodo que temos d eutilizar p/ fechar

Giovanni Donda - Gmail

unread,
May 11, 2007, 2:27:25 PM5/11/07
to jque...@googlegroups.com
tem como vc postar o codigo mais completo.............

Jean Nascimento escreveu:

Jean Nascimento

unread,
May 11, 2007, 2:36:54 PM5/11/07
to jque...@googlegroups.com
eskeci do codigo ¬¬

$(document).ready(
function()
{
$(".calendario").datePicker({startDate:'01/01/2007', endDate:'31/12/2007'});
$("#VOLTAR").click(function() {
history.back();
});
$("#fechar")
.bind("click", function(){
alert("num vo fexa");
window.close();


})
.mouseout(function(){
MM_swapImgRestore();
})
.mouseover(function(){
MM_swapImage('fechar','','../imgs/botao_fechar_over.png',1)
})

});

On 5/11/07, Jean Nascimento <jnasc...@gmail.com> wrote:
> AHUhuAHUAUH ta vo colocar td o codigo mas eh soh isso ae memo
> o esquema ehq eu vo xama as paginas no index memo e dae coloco o a
> img dentro do div dae soh do um hide hehehhe

Jean Nascimento

unread,
May 11, 2007, 2:36:26 PM5/11/07
to jque...@googlegroups.com
AHUhuAHUAUH ta vo colocar td o codigo mas eh soh isso ae memo
o esquema ehq eu vo xama as paginas no index memo e dae coloco o a
img dentro do div dae soh do um hide hehehhe

On 5/11/07, Giovanni Donda - Gmail <giovan...@gmail.com> wrote:

Giovanni Donda - Gmail

unread,
May 11, 2007, 3:12:33 PM5/11/07
to jque...@googlegroups.com
testa isso, tah em negrito !!!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
<script type="text/javascript" src="jquery.js">
  $(document).ready(function(){

      $("#fechar").bind("click",function(){
          $(window).close();
        });
    });
</script>

<br>
<form name="form1" method="post" action="">
  <input type="button" name="fechar" id="fechar" value="Button" onClick="window.close()">
</form>
</body>
</html>

cuidado com o include do jquery se for copiar e colar o codigo todo

window.close não funfou porque vc não coneguiu chegar até o objeto window, logo, usei $(window) e funfou.......

veja se era isto

abraços,
Giovanni Donda


Jean Nascimento escreveu:

Jean Nascimento

unread,
May 11, 2007, 3:19:58 PM5/11/07
to jque...@googlegroups.com
tb naum rolo
$(window).close is not a function
[Break on this error] $(window).close();

ae funcionou mesmo???

> window.close n�o funfou porque vc n�o coneguiu chegar at� o objeto window,


> logo, usei $(window) e funfou.......
>
> veja se era isto
>

> abra�os,

> abra�os,
> Giovanni
>
> Jean Nascimento escreveu:
>
>
> Seguinte mo�ada nao estou conseguindo fazer o jQuery fexar uma janela,


> alguem sabe como proceder? tentei com document.close() e
> window.close() e nd

> e eu tenho q fechar mesmo, n�o � pa sumir com div ehhehe

Giovanni Donda - Gmail

unread,
May 11, 2007, 3:25:34 PM5/11/07
to jque...@googlegroups.com
$(window).close()


Jean Nascimento escreveu:

Giovanni Donda - Gmail

unread,
May 11, 2007, 3:27:50 PM5/11/07
to jque...@googlegroups.com
vc copiou o codigo inteiro ????

cuidado com isso
<input type="button" name="fechar" id="fechar" value="Button" onClick="window.close()"> // forma antiga
troca para
<input type="button" name="fechar" id="fechar" value="Button">
<script type="text/javascript" src="jquery.js">

cuidado com a definição acima

use somente o codigo jquery abaixo

$(window).close(); no lugar do seu window.close 


Jean Nascimento escreveu:

Rafael Santos

unread,
May 11, 2007, 3:45:44 PM5/11/07
to jque...@googlegroups.com
Funcionou ae?
Onde diz que existe a função $.close() ??

Em 11/05/07, Giovanni Donda - Gmail <giovan...@gmail.com > escreveu:



--
Rafael Santos Sá :: webdeveloper
www.rafael-santos.com

Giovanni Donda - Gmail

unread,
May 11, 2007, 4:06:46 PM5/11/07
to jque...@googlegroups.com
testa ae, aqui funfou

Rafael Santos escreveu:
Funcionou ae?
Onde diz que existe a função $.close() ??

Em 11/05/07, Giovanni Donda - Gmail <giovan...@gmail.com > escreveu:
vc copiou o codigo inteiro ????

cuidado com isso
<input type="button" name="fechar" id="fechar" value="Button" onClick="window.close()"> // forma antiga
troca para
<input type="button" name="fechar" id="fechar" value="Button">
<script type="text/javascript" src="jquery.js">

cuidado com a definição acima

use somente o codigo jquery abaixo

$(window).close(); no lugar do seu window.close 


Jean Nascimento escreveu:
tb naum rolo
$(window).close is not a function
[Break on this error] $(window).close();

ae funcionou mesmo???

On 5/11/07, Giovanni Donda - Gmail 
<giovan...@gmail.com> wrote:
  
 testa isso, tah em negrito !!!

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 
"http://www.w3.org/TR/html4/loose.dtd"
>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html;  <title>Untitled Document</title>

 </head>

 <body>
 <script type="text/javascript" src="jquery.js">
   $(document).ready(function(){
       $("#fechar").bind("click",function(){

           $(window).close();
         });
     });
 </script>
 <br>
 <form name="form1" method="post" action="">
   <input type="button" name="fechar" id="fechar" value="Button"

onClick="window.close()">
 </form>
 </body>
 </html>

 cuidado com o include do jquery se for copiar e colar o codigo todo

 window.close n�o funfou porque vc n�o coneguiu chegar at� o objeto window,

logo, usei $(window) e funfou.......

 veja se era isto

 abra�os,
 Giovanni Donda


 Jean Nascimento escreveu:
 eskeci do codigo ��

$(document).ready(
 function()
 {
 $(".calendario").datePicker({startDate:'01/01/2007',

endDate:'31/12/2007'});
 $("#VOLTAR").click(function() {
 history.back();
 });
 $("#fechar")
 .bind("click", function(){
 alert("num vo fexa");
 window.close
();
 })
 .mouseout(function(){
 MM_swapImgRestore();
 })
 .mouseover(function(){
MM_swapImage('fechar','','../imgs/botao_fechar_over.png',1)
 })
 });

On 5/11/07, Jean Nascimento 
Desktop.zip
Reply all
Reply to author
Forward
0 new messages