/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
INSIDE THE HEAD ...................................................................... <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(function() { $("#trigger").click(function(event) { event.preventDefault(); $("#box").slideToggle(); }); $("#box a").click(function(event) { event.preventDefault(); $("#box").slideUp(); }); }); </script> HTML ...................................................................... <a href="#" id="trigger">TRIGGER</a> <div id="box"> <a href="#" class="close">[x]</a> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p> </div> CSS ...................................................................... #box { display: none; }
URL: http://www.webintenta.com/9914.html