… and i cant figure out why.
The script is following:
<script type="text/javascript" src="http://path/to/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
function openMediaPlayer() {
$('#flashMovie').animate({'height':'333px'});
}
function closeMediaPlayer() {
$('#flashMovie').animate({'height':'80px'});
}
jQuery(function($){
$('#videoholder').bind('mouseenter', function(){
openMediaPlayer();
});
$('#videoholder').bind('mouseleave', function(){
closeMediaPlayer();
});
});
</script>
<div id="videoholder" style="height:80px;width:412px;">
<object width="412" height="80" type="application/x-shockwave-flash" id="flashMovie" name="flashMovie" style="height: 80px;" data="http://path/to/Player.swf"><param name="menu" value="false"><param name="bgcolor" value="#666666"><param name="allowFullscreen" value="true"><param name="flashvars" value="playlistURL=http://path/to/Player/data/playlist.xml"></object>
</div>
pure and simple resizing flash object. It worked with older(1.3.2) jquery verision. The animate just does not work.
Can anyone tell me what i should change to get it working again?
Alan.
There’s no error because jQuery catches and throws away event handler errors in response to
mouseenter/mouseleave(line 2170 in 1.4.2). Bad jQuery! Usingmouseover/mouseoutinstead allows you to see the error.Which is: ‘queue is undefined’ on line 1177. This is caused by the previous call to
queue()failing, because the attempt to set thefxqueuedata item on the<object>fails. (But instead of raising an error to flag the failure, it silently returnsundefined. Bad jQuery!)jQuery 1.4.2 fails to set
data()on<object>(where 1.3.2 succeeds) because it deliberately won’t: it checks thejQuery.noDatavariable which tells it that<object>elements can’t have arbitrary (‘expando’) properties set on them, and jQuery’sdata()mechanism, and hence animation-queuing is dependent on this facility. Bad jQuery!Traditionally browsers have had trouble with expandos on
<object>, but specifically for the case of Flash, it does actually work in most modern browsers (even if it’s pretty bad practice). So you could try telling jQuery to shut up and allow you to animate plugin elements by saying:at some point before calling
animate.