/ Published in: jQuery

Div will fade in on load or fade in on click
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// The div #fader will fade in on load <style type="text/javascript" /> $(function(){ $('#fader').hide(); $('#fader').fadeIn() }); }); </script> // The div #fader will fade in when clicked <style type="text/javascript" /> $(function(){ $('#fader').click(function(){ $('#fader').fadeIn() }); }); </script> // The div a#fader will fade in when clicked. use return false for anchor tags <style type="text/javascript" /> $(function(){ $('a#fader').click(function(){ $('#fader').fadeIn() return false; }); }); </script>
Comments
