我的问题与 this one 几乎相同除了我使用的是 jQuery Mobile 1.0。整个项目已经编写完毕,我不想为了让这个滚动功能与我的可折叠集一起工作而将它更新到 1.3.2。我可以从链接问题中提供的答案中使用可以适应 1.0 的内容吗?
谢谢
最佳答案
滚动 工作不需要升级。只是监听expand事件的方式不同。
绑定(bind)
$(".ui-collapsible").bind("expand", function () {
/* scroll */
});
委托(delegate)
$(document).delegate(".ui-collapsible", "expand", function () {
/* scroll */
});
滚动
var position = $(this).offset().top;
/* scroll with animation */
$("html, body").animate({
scrollTop: position
});
/* scroll without triggering scroll event */
$.mobile.silentScroll(position);
关于javascript - 展开时 jquery Mobile 1.0 可折叠集的滚动位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22255234/