hackalive Posted April 29, 2012 Share Posted April 29, 2012 Hi guys I am using the HTML5 object http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_object and want to know how I can attach a funtion to it for onClick. Obviously <object width="400" height="400" data="helloworld.swf" onClick="alert('a')"></object> does not work, so is there a jQuery solution I can implement? Cheers in advance. Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/ Share on other sites More sharing options...
trq Posted April 29, 2012 Share Posted April 29, 2012 http://api.jquery.com/click Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341504 Share on other sites More sharing options...
hackalive Posted April 29, 2012 Author Share Posted April 29, 2012 See http://jsfiddle.net/CRSQS/1/ Does not work. Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341506 Share on other sites More sharing options...
trq Posted April 29, 2012 Share Posted April 29, 2012 Works as expected when you actually include the jQuery library instead of Mootools. Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341507 Share on other sites More sharing options...
hackalive Posted April 29, 2012 Author Share Posted April 29, 2012 It only works if I click on the extreme outer of the frame which is not what I want. Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341512 Share on other sites More sharing options...
trq Posted April 29, 2012 Share Posted April 29, 2012 You might have to lay a div over the frame to make the entire thing clickable. Quote Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341593 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.