是否有可能在iPhone上

问题描述:

触发onmouseover事件在iPhone 3G,是可以开枪狩猎onmouseover事件是否有可能在iPhone上

+2

它会是什么?用鼠标(你的手指)不能“悬停”,而不会触发点击或拖动事件。 – voyager 2010-02-06 19:31:39

+0

我知道这是不可能悬停,但iPhone Safari支持它。我已经在某个地方读过,这是可能的。 – Adeel 2010-02-06 19:42:52

是和否,行为与计算机上的行为不同,请参阅this list了解在iphone上触发鼠标悬停的操作。

不幸的是iPhone确实支持:(

来源的事件之一: http://www.evotech.net/blog/2007/07/web-development-for-the-iphone/

+0

请务必跳到本文中的“iPhone上的Safari不支持:”部分! – Urda 2010-02-06 19:36:44

这工作WebKit中如果iPhone Safari支持内部的事件,这可能工作

// Assuming the element you want to simulate a mouseover event with is "theElement" 
var mouseoverEvent = document.createEvent('MouseEvents'); 
mouseoverEvent.initMouseEvent('mouseover'); 
theElement.dispatchEvent(mouseoverEvent);