Problem: Need onclick event to pause/unpause a Youtube video, but impossible to add the evenlistener. Looks to me that the object is 'unclickable'.
Situation: Got a Youtube player initialized by swfobject, onYouTubePlayerReady is build as suggested in the docs (Google API docs) For HTML & JS see: http://ListAndPlay.com
What I tried: almost everything, from changing doctypes till forcing ID's while adding the eventlisteners, nothing worked.
I hope that one of 开发者_如何学JAVAyou see the flaw I made after hours...
i had the same problem before and -i think- i read somewhere in Jquery wiki that object doesn't fire any event because once you click on it you are inside flash object.
as an alternative solution i used a div with z-index:100 and placed it in front of the object and then you can use on click event when the client clicks on that div
i hope this helps
精彩评论