我有一个listview,我想要做的是在链接上添加一个滑动事件.例如,如果用户滑动第一个链接,则会转到该页面.这可能与listview元素一起使用.我试过div,href,a,li,ul但仍然没有警报.它适用于身体.谢谢
<div>
<ul data-role="listview" data-inset="true">
<li class="rqstpage"><a href="./requests.php">Requests</a></li>
<li><a href="./speakers.php" data-transition="pop">Control Panel</a></li>
<li><a href="./schedule.html">Schedule</a></li>
<li><a href="./information.html">Information</a></li>
</ul>
</div>
<script>
$("div ul li.rqstpage").bind('swipe',function(event, ui){
$.mobile.changePage("requests.php", "slide");
});
</script>
Run Code Online (Sandbox Code Playgroud)