Friday, 6 September 2013

Jquery: slideToggle, then scroll to div

Jquery: slideToggle, then scroll to div

I'm using slideToggle to display a div when a navigation button is
clicked. It's working, but the div that I'm displaying is pretty tall, so
you don't actually see much of it once it loads. The div sits directly
beneath the button you use to trigger slideToggle. I would like to find a
way to slideToggle the div, and then have the window scroll to the nav
button, automatically displaying the entire previously hidden div.
<a href="#"> doesn't work as it tries to jump to the element before the
slideToggle function has executed. Is there a way to have the window
scroll to the element after slideToggle has completed?
You can see what I have so far here.
Click on the "printables" button to see what I'm talking about.

No comments:

Post a Comment