我正在使用 Material Design Lite 为 Web View 中的应用程序创建 UI,但是我遇到了无法在滑动时部署抽屉导航的问题。
我正在使用这个 jquery 代码来识别滑动事件
$(function() {
$("#test").swipe( {
//Generic swipe handler for all directions
swipeRight:function(event, direction, distance, duration, fingerCount) {
$(this).text("Event Triggered" );
},
});
});
从这里我不确定如何打开抽屉导航。我更愿意让整个屏幕“可滑动”,尤其是左边缘。触发此滑动处理程序时,如何打开导航栏?
最佳答案
我试图在演示 Material 设计精简版中添加此效果,http://www.getmdl.io/templates/dashboard/index.html .所以我找到的解决方案是通过 Material Design Lite 生成的类“mdl-layout__drawer-button”来模拟汉堡包按钮的点击事件。
$(function() {
$("#test").swipe( {
//Generic swipe handler for all directions
swipeRight:function(event, direction, distance, duration, fingerCount) {
$(".mdl-layout__drawer-button").click();
},
});
});
关于javascript - 轻扫打开抽屉导航(Material Design Lite),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31362679/