点击并按住按钮以显示弹出窗口

时间:2015-08-12 06:50:53

标签: html5 popup taphold

如何更改或添加任何代码以点击并按住以显示弹出窗口,目前我按下按钮后会出现弹出窗口,我想将其更改为点击并按住。

<div   id="ScenePop1">
   <a href="#login_form1" id="scene1">1</a>
   <a href="#x" class="overlay1" id="login_form1"></a>
   <div class="popup1">
        <h2>Scene 1</h2>
        <button id="store1">Store</button>
        <button id="del1">Delete</button>
        <a class="close1" href="#close"></a>
    </div>
</div> 

我的代码在这里:http://jsfiddle.net/oajt5p28/

1 个答案:

答案 0 :(得分:0)

这个链接通过jquery,jmobile和simpledialog2的组合得到了优雅的解决方案:http://www.raymondcamden.com/2012/05/23/Context-Menu-Example-with-jQuery-Mobile

或者使用可以使用html5对话框元素,并按照以下方式捕获taphold事件: How to detect a long touch pressure with javascript for android and iphone?