ask Posted June 28, 2012 Report Share Posted June 28, 2012 (edited) Olá, sou novo aqui por isso se tiver a fazer algo de errado não se zanguem 😛 Bem, é o seguinte eu queria reverter o efeito que dei nestas div's quando clico no botão vermelho que aparece, já tentei fazer .animation mas quando faço as div's fazem o efeito e parece que fazem reload e param. Preciso mesmo de ajuda porque quero aprender mais e ainda sou muito novo em jquery.. Espero que me possam ajudar e agradeço a quem o fizer. 😉 Aqui fica o código: <html> <head> <title>Title of the document</title> <script src="http://code.jquery.com/jquery-latest.js"></script> <style type="text/css"> * { margin:0px; padding:0px; border:0px; } body { background:url(fundo.png) repeat-x center #000000; } #main { width:950px; padding:5px 5px 0px 5px; background:#FFFFFF; margin-left:auto; margin-right:auto; margin-top:10px; overflow:auto; } #slide { width:950px; height:150px; background:#000000; margin-bottom:5px; } #about { width:950px; margin-bottom:5px; overflow:auto; } #about_bt { width:950px; height:30px; background:#000000; } #about_btx { width:20px; height:20px; margin:5px; float:right; background:#ff0000; } #team { width:950px; margin-bottom:5px; overflow:auto; } #team_bt { width:950px; height:30px; background:#000000; } #team_btx { width:20px; height:20px; margin:5px; float:right; background:#ff0000; } </style> </head> <body> <div id="main"> <div id="slide"></div> <div id="about"> <div id="about_bt"><div id="about_btx"></div></div> <div id="about_con">conteudo about</div> </div> <div id="team"> <div id="team_bt"><div id="team_btx"></div></div> <div id="team_con">conteudo team</div> </div> </div> <script> $("#about_btx").hide(); $("#team_btx").hide(); $("#about_con").hide(); $("#team_con").hide(); //about $("#about_bt").click(function() { $("#about_btx").fadeIn("fast"); $("#about_con").slideDown("slow"); $("#team").animate({height:"0px",opacity:"0",margin:"0",}); $("#slide").animate({height:"0px",opacity:"0",margin:"0",}, "0"); }); </script> </body> </html> Cumprimentos 👍 Edited June 29, 2012 by brunoais geshi! Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted June 28, 2012 Report Share Posted June 28, 2012 o hide é para esconder ... o inverso é o show não tenho a certeza que o fadeIn e afins servem para voltar a aparecer isto porque o que acontece quando fazes hide, é alterado o atributo do css "display" para : none como nunca experimentei algo que não seja o inverso: fadeIn <-> fadeOut slideDown <-> slideUp ... não te posso dar mais informações IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ask Posted June 28, 2012 Author Report Share Posted June 28, 2012 obrigado pela informação, o que me esta a causar dores de cabeça é o animate, quero que as div's volte ao normal e não estou a conseguir.. Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted June 28, 2012 Report Share Posted June 28, 2012 animate({...,opacity:"0", ... ,}); alem de teres o erro de javascript te teres uma virgula a mais no final (mas acho que o javascript come isso) pretendes que o opacity vá até ao valor de completamente transparente ?? não seria ao contrário ?? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ask Posted June 28, 2012 Author Report Share Posted June 28, 2012 não, eu tenho que criar uma opção para quando clicar no botão de X (vermelho, com id="btx") volte a ter a opacidade a 100, o height a 150px e margin-bottom a 5px, e a mesma coisa para o team, ou seja, quero que volte tudo ao inicio mas com o mesmo efeito que fiz. Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted June 28, 2012 Report Share Posted June 28, 2012 então se sabes o que fazer e como fazer qual é a dúvida ??? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ask Posted June 28, 2012 Author Report Share Posted June 28, 2012 a maneira como sei fazer penso que não dê porque quando fiz ao clicar no botão vermelho fazia o efeito e depois desaparecia... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now