开发者

Jquery mobile - saving scroll position

So I just have a quick question. I have a listbox that pops up a view that fills the screen. Once the view is dismissed, the window scrolls up back to the top. Does anyone know how to disable this behavior, or save the mouse position so I can silentScroll() back to it after th开发者_开发百科e popover disappears? Thanks


I have this bit in the head to disable the native browser menus for dropdowns and the like:

<script type="text/javascript">
        $(document).bind('mobileinit',function(){
            $.mobile.selectmenu.prototype.options.nativeMenu = false;
        });     
</script>


Alright, I solved the problem by doing this in the "pagehide" method:

$("body").css("overflow", "hidden");

and then this in the "pageshow" method:

$("body").css("overflow", "auto");

Hope that helps someone.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜