如何在触摸屏iphone上实现onmousedown和onmouseup [英] How to impliment a onmousedown and onmouseup on a touch screen iphone
问题描述
我对HTML / Java很新,但我正在学习...
I've very new to HTML/Java but am learning...
我想在iphone上开发一个按钮,当按下时运行java脚本命令当它被释放。我使用onmousedown和onmouseup属性完成了这个查找,但这不起作用。
I want to develop a button on an iphone that runs a java script command when press and when it is released. I've done this find using onmousedown and onmouseup attributes, but this does not work the same.
有人可以指点我如何在iphone上做同样的事情吗?
could someone please point me in the right direction as to how to do this same thing on the iphone?
推荐答案
相当于<触摸屏设备上的code> onmousedown 是 ontouchstart
,相当于 onmouseup
是 ontouchend
。
如果您还想检测拖动,可以使用 ontouchmove
每次触摸屏幕后移动手指都会触发。
If you would also like to detect dragging, you could use ontouchmove
which is fired every time you move your finger after touching the screen.
这篇关于如何在触摸屏iphone上实现onmousedown和onmouseup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!