Posted By

kstetson on 06/03/09


Tagged

div jquery click load fade snippet on in


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


Div Fade in on Load / Div Fade in on Click


 / Published in: jQuery
 

Div will fade in on load or fade in on click

  1. // The div #fader will fade in on load
  2.  
  3. <style type="text/javascript" />
  4. $(function(){
  5. $('#fader').hide();
  6. $('#fader').fadeIn()
  7. });
  8. });
  9. </script>
  10.  
  11. // The div #fader will fade in when clicked
  12.  
  13. <style type="text/javascript" />
  14. $(function(){
  15. $('#fader').click(function(){
  16. $('#fader').fadeIn()
  17. });
  18. });
  19. </script>
  20.  
  21. // The div a#fader will fade in when clicked. use return false for anchor tags
  22.  
  23. <style type="text/javascript" />
  24. $(function(){
  25. $('a#fader').click(function(){
  26. $('#fader').fadeIn()
  27. return false;
  28. });
  29. });
  30. </script>

Report this snippet  

You need to login to post a comment.