Jquery mobile 用JQuery移动在中间打开面板?
我的导航标题中有一个小的条形按钮,当单击时会打开面板,但如何使它在我从应用程序中间向右滑动时打开左侧面板?你可以在包括Facebook在内的许多本地应用程序上看到这一点。谢谢你的帮助 我认为这就是您想要的(您可能需要为您的刷卡区域优化选择器)-Jquery mobile 用JQuery移动在中间打开面板?,jquery-mobile,mobile,mobile-website,jquery-mobile-panel,Jquery Mobile,Mobile,Mobile Website,Jquery Mobile Panel,我的导航标题中有一个小的条形按钮,当单击时会打开面板,但如何使它在我从应用程序中间向右滑动时打开左侧面板?你可以在包括Facebook在内的许多本地应用程序上看到这一点。谢谢你的帮助 我认为这就是您想要的(您可能需要为您的刷卡区域优化选择器)- 我想这就是您想要的(您可能需要为您的刷卡区域优化选择器)- 收听刷卡事件swipelft和swiperight,并相应地打开面板$('#id')。面板('open') 收听刷卡事件swipelft和swiperight,并相应地打开面板$('#id')
我想这就是您想要的(您可能需要为您的刷卡区域优化选择器)-
收听刷卡事件
swipelft
和swiperight
,并相应地打开面板$('#id')。面板('open')
收听刷卡事件
swipelft
和swiperight
,并相应地打开面板$('#id')。面板('open')
以下是文件:
以下是文件:
$('body').on('swiperight', function () {
$('#defaultpanel').panel('open', '');
});
$('body').on('swipeleft', function () {
$('#defaultpanel').panel('close');
});
$(document).on('swipeleft swiperight', function (e) {
if (e.type == 'swiperight') {
$('#left').panel('open');
}
if (e.type == 'swipeleft') {
$('#right').panel('open');
}
});
$( document ).on( "pageinit", "#demo-page", function() {
$( document ).on( "swipeleft swiperight", "#demo-page", function( e ) {
// We check if there is no open panel on the page because otherwise
// a swipe to close the left panel would also open the right panel (and v.v.).
// We do this by checking the data that the framework stores on the page element (panel: open).
if ( $.mobile.activePage.jqmData( "panel" ) !== "open" ) {
if ( e.type === "swipeleft" ) {
$( "#right-panel" ).panel( "open" );
} else if ( e.type === "swiperight" ) {
$( "#left-panel" ).panel( "open" );
}
}
}); });