【发布时间】:2011-12-22 09:32:19
【问题描述】:
我正在开发一个 jquery 移动项目。我有两个 html 页面。从 index.html 我有一个向 page.html 的 swipeleft 事件,它工作正常。从 page.html 我想向右滑动,所以我回到 index.html 但这不起作用。
如果我在单个文档内的内部页面之间滑动,而不是在 html 页面之间滑动,则代码可以正常工作。而且我需要使用几个 html 页面。
有没有人解决这个问题?将不胜感激。
这是我在 index.html 页面中的滑动代码:
<script>
$(document).ready(function() {
$("#main").bind('swipeleft',function(event, ui){
$.mobile.changePage("page.html", "slide");
})
})
</script>
这是我的 page.html 代码:
<script>
$(document).ready(function() {
$("#main").bind('swiperight',function(event, ui){
$.mobile.changePage("index.html", "slide");
})
})
</script>
【问题讨论】:
标签: jquery jquery-mobile swipe