Vivek Dragon
Vivek Dragon

Reputation: 2248

slide down height like accordion

Guys i am working on a div which shows a calender by onclick(). I used toggle method to show and this that calender.

But while scrolling down i want to make the height of the div to change like this accordion.

I want to move my div a little above so that the calender will be visible to the user. Any ideas to animate the height which is used in that accordion?

Check this

[http://jsfiddle.net/vivekdx/VVP3v/2/]

I like to move the calender when i click "Show me the calender"

Upvotes: 1

Views: 259

Answers (1)

bipen
bipen

Reputation: 36531

try this...

 $('html, body').animate({ scrollTop: $('#calender').position().top }, 'slow');

here is the fiddle..

http://jsfiddle.net/VVP3v/5/

you are using slide toggle... so the effect might not look as it is in live.. :)

Upvotes: 1

Related Questions