Hi I have a bit of code which works with Jquery and works perfectly in all browsers except ie (and it doesn t seem to work in any ie browsers -7, 8, 9). The Jquery code is as follows.. can anyone see a problem:
$(document).ready(function () {
var obj = $('object')
.wrap('<div id="test"></div>')
.find('embed').attr('src', function (i, s) { return s + '&enablejsapi=1&version=3' }).end()
.find('param[name=movie]').attr('value', function (i, v) { return v + '&enablejsapi=1&version=3' }).end()
.detach()
.appendTo($('#test'));
$(document).ready(function () {
$("#emsbinstartbutton").click(function () {
//Then assign the src to null, this then stops the video been playing
obj.find('embed')[0].pauseVideo();
$("body").append($("<div>").css({
position: "fixed"
, width: "640px"
, height: "425px"
, "background-color": "#000"
, opacity: 0.6
, "z-index": 999
, top: 0
, left: 0
}).attr("id", "page-cover"));
$("#threebytwo").show();
});
});
This code makes a widget pop up when a user clicks a buy now button:
$("#threebytwo").show();
Here is a jsfiddle of the whole code which you can see wokring in Firfox chrome and safari but not working in ie.
I looked this up and saw a trick where you set the meta data tag to ie 8 but i have tried this but it hasn t worked.
I think i need to read up a bit more on cross browser issues as i keeep coming across them but nay help is appreciated!
Edit Sorry to clarify what the actual problem is - when you click the buy now button there should be a pop up
Edit 2
as pointed out in one of the comments it is this line which stop the code working in ie:
obj.find('embed')[0].pauseVideo();
Thanks