jquery mobile 使滚动条滚动到底部scrollTop函数无效的解决方法
2015-02-17 11:32
681 查看
$('body').scrollTop(100);
我们使用上面的scrollTop函数时发现滚动后又闪回顶部,原因是在jquery mobile 中要使用另外的函数
$.mobile.silentScroll(100); 这个函数需要你点击DIV再调用才有效果,如果一开始就设置是没效果的
像下面用是没效果的
$(document).ready(function() {
$.mobile.silentScroll(100);
});
需要像下面这样才有效果
$(document).ready(function() {
$('div').on('click',function(){$.mobile.silentScroll(100);});
});
下面是在网上找到的,设置滚顿条位置
设置根据显示时宽度的最大最小信息设置html断点,我没用过,我猜会让断点以后的html不显示。$.mobile.addResolutionBreakpoints (method)Add width breakpoints to the min/max width classes that are added to the HTML element.
我们使用上面的scrollTop函数时发现滚动后又闪回顶部,原因是在jquery mobile 中要使用另外的函数
$.mobile.silentScroll(100); 这个函数需要你点击DIV再调用才有效果,如果一开始就设置是没效果的
像下面用是没效果的
$(document).ready(function() {
$.mobile.silentScroll(100);
});
需要像下面这样才有效果
$(document).ready(function() {
$('div').on('click',function(){$.mobile.silentScroll(100);});
});
下面是在网上找到的,设置滚顿条位置
//scroll to Y 100px $.mobile.silentScroll(100);
设置根据显示时宽度的最大最小信息设置html断点,我没用过,我猜会让断点以后的html不显示。$.mobile.addResolutionBreakpoints (method)Add width breakpoints to the min/max width classes that are added to the HTML element.
//add a 400px breakpoint $.mobile.addResolutionBreakpoints(400); //add 2 more breakpoints $.mobile.addResolutionBreakpoints([600,800]);
相关文章推荐
- XHTML document.body.scrollTop无效解决方法
- 解决js页面滚动效果scrollTop在FireFox与Chrome浏览器间的兼容问题的方法
- 解决js页面滚动效果scrollTop在FireFox与Chrome浏览器间的兼容问题的方法
- 解决js页面滚动效果scrollTop在FireFox与Chrome浏览器间的兼容问题的方法
- 聊天窗口内容滚动到底部的方法scrollTop和scrollIntoView
- 不同浏览器对document.documentElement和document.body的scrollheight ,scrollTop,clientHeight以及判断滚动条是否滚动到页面最底部 【转载】
- document.body.scrollTop无效的解决方法
- 不同浏览器对document.documentElement和document.body的scrollheight ,scrollTop,clientHeight以及判断滚动条是否滚动到页面最底部 【转载】
- document.body.scrollTop无效的解决方法
- 解决Ext.Window放大关闭后滚动条消失和滚动页面时最大化Window位置的方法
- 解决Ext.Window放大关闭后滚动条消失和滚动页面时最大化Window位置的方法
- IE8 底部补丁无效Bug 解决方法
- 让DIV的滚动条自动滚动到最底部 - 4种方法
- margin-top无效的解决方法
- FireFox下设置DIV的top和left无效解决方法
- 在 360浏览器下 position:relative; 不随着滚动条的滚动而滚动而是飘在页面上 解决方法 给父级也就是出现滚动条的元素添加 position:relative;就ok l了
- document.body.scrollTop 值总为0的解决方法 比较常见的标准问题
- 让DIV的滚动条自动滚动到最底部 - 4种方法
- document.body.scrollTop 值总为 0 的解决方法
- document.body.scrollTop 值总为0的解决方法 比较常见的标准问题