开发者

Is it possible to trigger onmouseover event on iPhone

开发者 https://www.devze.com 2022-12-19 04:04 出处:网络
On iPhone 3G, is i开发者_如何学Got possible to fire onmouseover event on safariYes and no, the behavior is not the same as on a computer, see this list for what triggers mouseover on the iphone.This w

On iPhone 3G, is i开发者_如何学Got possible to fire onmouseover event on safari


Yes and no, the behavior is not the same as on a computer, see this list for what triggers mouseover on the iphone.


This works in WebKit. If iPhone Safari supports the event internally, this may work.

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


Unfortunately that is one of the events the iPhone does not support :(

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

0

精彩评论

暂无评论...
验证码 换一张
取 消