Android Kit Kat上的按钮点击只有在多次点击phonegap构建应用程序后才会激活
Button Click on Android Kit Kat only activates after many clicks in phonegap build app
我最近建立了一个phonegap应用程序,它有一个菜单,从左边滑进视图,当你点击实际菜单上的链接时关闭。
我正在使用jquery插件fastclick来删除触摸设备上的300ms延迟。下面是滑动菜单的代码。
$('#showLeftPush').click(function (e) {
e.preventDefault();
if ($(this).hasClass('show')) {
$("#cbp-spmenu-s1").animate({
left: "-=130"
}, 300, function () {
// Animation complete.
console.log('menu closed');
});
$(this).removeClass('show').addClass('hide');
}
else {
$("#cbp-spmenu-s1").animate({
left: "0"
}, 300, function () {
// Animation complete.
console.log('menu open');
});
$(this).removeClass('hide').addClass('show');
}
console.log('menu clicked');
});
该代码在kit kat 4.4.1之前的android版本上运行良好。当我点击showLeft按钮时,有时菜单只有在点击10次左右才会打开。
有什么是我应该知道的还是我错过了什么
请帮忙,这个问题我已经坐了2天了
你可以尝试使用Tap Event代替点击Android Kitkat。
$('#showLeftPush').on("tap", function (e) {
e.preventDefault();
if ($(this).hasClass('show')) {
$("#cbp-spmenu-s1").animate({
left: "-=130"
}, 300, function () {
// Animation complete.
console.log('menu closed');
});
$(this).removeClass('show').addClass('hide');
}
else {
$("#cbp-spmenu-s1").animate({
left: "0"
}, 300, function () {
// Animation complete.
console.log('menu open');
});
$(this).removeClass('hide').addClass('show');
}
console.log('menu clicked');
});
你尝试过简单的面板小部件在jQuery移动?给出如下示例
<div data-role="panel" id="mypanel" data-theme="b">
<h3 align="center">Menu</h3>
<ul id="list" data-role="listview" data-inset="true">
<li><a href="driving_style.html" target="testframe" onclick=" header('Driving style')" data-rel="close">Driving style</a></li>
<li><a href="history.html" target="testframe" onclick=" header('History')" data-rel="close">History</a></li>
<li><a href="policy.html" target="testframe" onclick=" header('Policy')" data-rel="close">Policy</a></li>
<li><a href="contact_us.html" target="testframe" onclick=" header('Contact us')" data-rel="close">Contact us</a></li>
<li><a href="settings.html" target="testframe" onclick=" header('Settings')" data-rel="close">Settings</a></li>
</ul>
</div>
相关文章:
- 唤醒程序插件的PhoneGap构建代码没有'不起作用
- Phonegap构建:通知/弹出在android中不起作用
- 如何在警报框中使用 history.go(-1) Javascript,通过 phonegap 构建 jQuery 移动
- 如何在Phonegap构建中获取PHP页面
- 在PhoneGap Build上构建Windows Phone 7应用程序
- 在PhoneGap Build上构建Android应用程序
- Phonegap函数未在Phonegap构建应用程序中定义 - 推送通知也不起作用
- JQuery Ajax调用在构建后在Phonegap中不起作用
- 由ios7中的phonegap构建的Web应用程序的窗口比正常情况大
- 如何在使用 PhoneGap/Cordova 构建的 Android 应用程序中单击按钮时播放音频
- Windows 7 上 Android 的 Phonegap 3.0 构建错误
- Phonegap构建,HTML5音频,Android
- PhoneGap在iPad上构建ChildBrowser插件问题-关闭后重新打开
- 使用Javascript如何在移动设备上从使用PhoneGap构建的应用程序中解压缩文件
- Phonegap/Cordova代码在构建时不断重置
- Android在Phonegap构建中不响应软按键
- Phonegap构建不起作用
- Phonegap构建插件不包括在内
- PhoneGap构建没有更新我的所有文件
- PhoneGap云构建:正确安装facebookConnectPlugin