I’m embedding a third-party flash object on my website, and attempting to add a link to it by binding a jquery .click event to its wrapper div. In firefox this is working. In Chrome and IE, however, it would appear that there is no div accessible through the jQuery .click event. What I mean by that is, when binding ALL elements on the page to alert something on click, clicking the flash object does not throw an alert (except in firefox).
$("*").each(function() {
$(this).click(function() {
alert($(this));
});
});
I read elsewhere to give the flash object a param of wmode = “transparent”…which got it working in FF.
Here’s how the flash object is being embedded.
<?php if ($post->post_name == 'insurance') {?>
<script type="text/javascript">
var flashvars = {};
var params = {};
params.wmode = "transparent";
params.menu = "false";
params.allowScriptAccess = "never";
params.allowNetworking = "internal";
swfobject.embedSWF("/wp-content/uploads/2012/06/ad_Imagine_300x250_FLASH1.swf", "myRightRailAd", "300", "250", "10.0.0", false, flashvars, params);
<div id="adboxrightcol" class="adHolder" style="z-index: 1000;">
<div id="myRightRailAd" style="position: absolute;">
<img id="myContent" src="<?php bloginfo('url');?>/wp-content/uploads/2012/06/ad_Imagine_300x250_JPG1.jpg" alt="BMO" width="300" height="250">
</div></div>
And the jQuery click event being binded:
$(document).ready(function() {
$("#adboxrightcol").click(function() {
location.href="http://www.somesite.com/car-insurance-quotes?utm_source=comparasave_ad&utm_medium=comparasave_insurancelp&utm_campaign=imagine_bb_ad";
});
});
fixed the problem…had to use an absolutely positioned div on top of the flash object that is NOT a wrapper of the flash object, with a transparent image as a background for IE6 – 8