Jump to an anchor link on function complete in jQuery?
I have a simple slidetoggle function that opens onclick. What I'd like to do is jump the user down to the bottom of the page following the opened div. Basically, wait for the slidetoggle to complete - then imagine clicking my jump link to pull the viewport down. Here's my code.
$('#clickme').click(function() {
$('#form-area').slideToggle('slow', function() {
// Animation complete
// what can i put here that's like my standard jumpto?
});
});
<a href="#form-bottom" id="clickme">Click here<开发者_StackOverflow社区/a>
<div class="main" id="form-area" >
Stuff
</div>
<a name="form-bottom"></a>
This should work:
location.href = '#form-bottom';
精彩评论