如何在jquery HideShow()之后保持滚动位置? [英] How Do I maintain scroll position after jquery HideShow()?

查看:288
本文介绍了如何在jquery HideShow()之后保持滚动位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有以下代码用于隐藏和显示DIV控件



Hi I have the following code for hiding and showing a DIV control

   <script type="text/javascript">
       $(document).ready(function () {
           $('#multipleaccpanel').hide();

           $('a#multipleaccounttrigger').click(function () {
               $('#multipleaccpanel').toggle(400);

           });


       });
</script>





我的问题是当我点击显示div的底部时,它会将我带回到顶部页。是否有任何命令可以保持滚动位置



my problem is when I clicked on the bottom which shows the div, it takes me back at the top of the page. Is there any command that will maintain the scroll position

推荐答案

document )。ready( function (){
(document).ready(function () {


' #multipleaccpanel')。hide();
('#multipleaccpanel').hide();


' #multipleaccounttrigger')。点击( function (){


这篇关于如何在jquery HideShow()之后保持滚动位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆