Hey all, I'm looking for a fresh set of eyes to check out this code and see if you can tell me why it isn't working properly... I've actually used this same code before with 1.3.2 and it is fine, but for some reason with 1.4.1 I'm having troubles... am I missing something?
$(".item").click(function() {
var yt_vid = $(this).children('img').attr("id");
$("#youtube").fadeOut(300, function() {
$("#youtube").replaceWith('<object id="youtube" type="application/x-shockwave-flash" style="width:488px; height:300px; display:none;" data="http://www.youtube.com/v/' + yt_vid + '&hl=en_US&fs=1&hd=1"><param name="movie" value="http://www.youtube.com/v/' + yt_vid + '&hl=en_US&fs=1&hd=1" /><param wmode="transparent"><\/param><\/object>');
$('#youtube').fadeIn(1000);
});
});
The #youtube is added on document load with the following code:
var initialVid = $(".item").children('img').attr("id");
$("#youtubePlayer").append('<object id="youtube" type="application/x-shockwave-flash" style="width:488px; height:300px;" data="http://www.youtube.com/v/' + initialVid + '&hl=en_US&fs=1&hd=1"><param name="movie" value="http://www.youtube.com/v/' + initialVid + '&hl=en_US&fs=1&hd=1" /><param wmode="transparent"><\/param><\/object>');
Anytime I click .item, i get error 'D is not defined' in firebug and down the list i see an error on line 36 (the #youtube.fadeOut line)
Thanks!