开发者

Jump to an anchor link on function complete in jQuery?

开发者 https://www.devze.com 2022-12-28 00:47 出处:网络
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 -

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

精彩评论

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