javascript - JqueryMobile 页面中的同一页面导航

标签 javascript jquery html jquery-mobile

我有一个使用 Jquery Mobile 的页面。我尝试过使用简单的 anchor

<a href="#section1">Text</a>


<div id="section1"> 
text
</div>

但调用 Jquery Mobile 时似乎这是不可能的。有谁知道可用的解决方法?我搜索了一段时间,似乎找不到任何真正有效的东西。我试图简单地向下移动到同一 html 文档中的某些部分。

最佳答案

您可以使用$.mobile.navigate("#section1");

<a href="#section1" onclick="$.mobile.navigate( '#section1' );">Text</a>

<div id="section1"> 
text
</div>

文档:https://api.jquerymobile.com/jQuery.mobile.navigate/

关于javascript - JqueryMobile 页面中的同一页面导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40500534/

相关文章:

javascript - 我应该在颠覆系统中包含压缩文件吗?

javascript - getBlock ('meta' ) 在 DocPad 中如何工作?

javascript - IE 中的换行问题

javascript - 在 knockout 自定义绑定(bind)中添加事件处理程序

javascript - jQuery 文件上传导致浏览器崩溃

javascript - 脚本在 JSfiddle 中运行但不在浏览器上运行

javascript - 领英 API : how can I use a value stored in a variable to post network update

javascript - 如何使用 Adob​​e Brackets 转译 coffeescript

javascript - 在选中复选框之前隐藏 div

javascript - 如果已访问后代节点的链接,是否可以从 DOM 中删除元素?