开发者

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';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜