如何在框架 7 中实现双击
how to implement double tap in framework 7
我正在尝试在卡片上实现双击。卡片显示正常,但双击时不会执行任何操作。我尝试使用"dblclick"但它不起作用,可能是因为它在框架 7 中是不允许的。请建议正确的方法。
$$('.ord').on('taphold', function() {
var identity=this.id.toString();
myApp.modal({
title:'Quantity',
text:'<p>'+$$("#menuItem"+this.id.toString()).text()+ '<span style="float:right">'+$$("#menuPrice"+this.id.toString()).text()+'</span></p>'+'<p id="qty">'+quantity[parseInt(identity)]+'</p><p class="buttons-row"><button class="button button-raised button-fill color-red" id="increase" onClick="addUp('+identity+')">inc</button> <button class="button button-raised button-fill color-red" id="decrease" onClick="sub('+identity+')">dec</button></p>',
buttons:[
{
text:'add',
onClick: function() {
if (quantity[parseInt(identity)]>0)
{
var obj={name:$$("#menuItem"+identity).text(),price:$$("#menuPrice"+identity).text(),Quantity:quantity[parseInt(identity)],Category:allCategory[parseInt(identity)]};
orderArray.push(obj);
}
}
},
{
text:'cancel',
onClick:function() {
quantity[parseInt(identity)]=0;
document.getElementById("qty").innerHTML=quantity[parseInt(identity)];
}
},
]
})
});
<span class="ord" id='+i+'><div class="card" id="listId"><div class="card-content color-white" style="background-color:red;"><div class="card-content-inner"><p><b><span id="menuItem'+i+'">' + allItems[i] + '</span><span style="float:right" id="menuPrice'+i+'">' + allPrices[i] + '</span></b></p></div></div></div></span>
这是我用来退出应用程序的示例:首先添加事件侦听器,计算点击次数并在双击时退出。
// activate back button
document.addEventListener('backbutton', onBackKeyDown, false);
// functions on back button
function onBackKeyDown() {
if ($$('.page-on-center').length === 0 || $$('.page-on-center').attr('data-page') === 'index-1') {
if (backi === 1) {
backi = 0;
navigator.app.exitApp();
}
else {
backi++;
myApp.addNotification({
message: 'Tap twice to leave App.',
button: {
text: 'No, thanks.'
}
}
});
}
// end else
}
//end else if
else {
$$('.back').click();
}
return backi;
};
相关文章:
- 使用类从一个标记中双击事件
- onclick函数需要双击,因为类分配延迟
- 了解双击代码标记
- jquery Onclick函数带有导致双击的回调排序函数
- 防止双击执行两次jQuery post请求
- JavaScript双击事件
- 选择“字符串”并使用SeleniumJava双击
- jQuery UI自动完成需要在iOS上双击
- 使用jquery在html中添加双击操作
- 双击泛光灯单击
- 如何在Firefox中禁用视频的单击和双击控件
- 双击可更改树标签
- svg.js/svg平移缩放-双击交互
- 在WordSmith jquery中,双击后什么决定了链接图标的位置
- 宣传单:双击时不要触发点击事件函数
- d3 中是否有点击和双击事件.js力定向图
- 当单选按钮的标签可单击时双击
- 如何在框架 7 中实现双击
- 如何实现 HTML5 双击点击标签
- 我需要实现一个动作,双击,然后打开一个新的窗口.(sigma.js)