我正在使用touchmove事件上的event.preventDefault()正常工作面板幻灯片。但它会停止我的应用程序中的所有滚动。
如果没有此代码,我无法顺利打开侧面板。 (它在3-4次尝试后打开)
$(document).on('touchmove', function(event){
event.preventDefault();
});
用手指右键滑动打开/关闭面板的代码
$(document).on('pageinit', function(event){
// Bind the swipeHandler callback function to the swipe event on div.box
$( "[data-role='page']" ).on( "swiperight", function( event, ui ) {swipeRightHandler($.mobile.activePage.attr('id'));} );
function swipeRightHandler( page_id ){
$( "#"+page_id+"_panel" ).panel( "open" );
}
});