|
本帖最后由 xpoqx 于 2014-6-1 10:39 编辑
学习“第九讲 phonegap 教程 Jquery Mobile 面板(panel)详解”的帖子
教程里面的
【手指左右触摸 实现面板显示与隐藏js 代码】
手指左右触摸 实现面板显示与隐藏js 代码- <script>
- $( 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" );
- }
- }
- });
- });
- </script>
[color=rgb(51, 102, 153) !important]复制代码
这段代码 我复制进 页面了
在手机上测试 不是很灵敏 经常滑动打不开页面
如何解决呢?
|
|