xill2678
asked on
jQuery expand/collapse
i have a code snippet i picked up from somewhere (i can't remember where now) but i'd like to add a simple fading effect to it. this snippet uses jQuery's slideToggle function to simply expand & contract a div. I'd like to also add jQuery's fading function to this, but i havent been able to figure out how (i'm new to this stuff). I'd like the div to fade in when expanding, and fade out when contracting. can anyone give me any pointers on this? thanks
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript">
$(function(){
$("#trigger").click(function(event) {event.preventDefault();$("#hidden").slideToggle();});
});
</script>
<a href="# id="trigger">expand/contract div below</a>
<div id="hidden" style="display:none;">
content to fade here
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER