是否有可能在iPhone上触发onmouseover事件

时间:2010-02-06 19:28:24

标签: javascript iphone safari

在iPhone 3G上,是否可以在safari上启动onmouseover事件

3 个答案:

答案 0 :(得分:3)

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

答案 1 :(得分:1)

这适用于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);

答案 2 :(得分:0)

不幸的是,这是iPhone 支持的事件之一:(

来源: http://www.evotech.net/blog/2007/07/web-development-for-the-iphone/

相关问题