Div Fade in on Load / Div Fade in on Click


/ Published in: jQuery
Save to your folder(s)

Div will fade in on load or fade in on click


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.