PDA

View Full Version : Slight tweak to toggle div


jessnoonyes
06-05-2008, 07:25 PM
I previously posted about how to show only a portion of a div and toggle open the rest. Rangana was a huge help to me with that and I got the gist of what I needed to do and modified a jQuery script that does just that. However now my problem is that when the page loads it shows the entire div, and then when it's clicked it closes upwards to the height I want it to be when the page loads. Kind of the reverse of what I wanted.

You can see what I've got so far here:
http://www.jnsitedesign.com/slide/index.html

It's not pretty but I'm trying to just get the functionality figured out. Any ideas on how to set it to only show the small height by default?

Here's my javascript:
<script type="text/javascript">
$(document).ready(function() {
jQuery.easing.def = 'easeOutBack';


$('#content').css({overflow:"hidden"}).toggle(function() { $(this).animate({height:280}, 1500);},function()

{ $(this).animate({height:"950"}, 1000);})
});

</script>

Thanks!