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. 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 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. 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/261792-jquery-onclick-handler/#findComment-1341593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.