Reputation: 5656
... 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.
Upvotes: 2
Views: 1967
Reputation: 1
I also got this error at line number 1899 [jquery1.7.2 uncompressed]. I replaced the following and it worked.
From:
var match = jQuery.noData[ elem.nodeName.toLowerCase()];
to:
var match = jQuery.noData[ elem.nodeName.toString().toLowerCase()];
Upvotes: 0
Reputation: 49
'Can anyone tell me what i should change to get it working again?'
Change your 'flashMovie' to height 100% widht 100% and animate on videoholder, don`t think it will work in ie tho... it seams to be working, but i cant test it any further you ll have to see. g2g
Upvotes: 0
Reputation: 322492
From jQuery 1.4.2, line 993
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
"object": true,
"applet": true
},
When attempting to set the elements data()
on line 1002, jQuery appears to first check to see if it has one of the three elements listed above. If so, it returns immediately.
data: function( elem, name, data ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
return;
}
...
I won't pretend to be a very knowledgeable "under the hood" guy, but I think this may be the root of the problem, and appears to be intentional.
EDIT:
The solution bobince gave to override jQuery's noData
, would seem to be the way to go.
Upvotes: 3
Reputation: 536389
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! Using mouseover
/mouseout
instead 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 the fxqueue
data item on the <object>
fails. (But instead of raising an error to flag the failure, it silently returns undefined
. Bad jQuery!)
jQuery 1.4.2 fails to set data()
on <object>
(where 1.3.2 succeeds) because it deliberately won't: it checks the jQuery.noData
variable which tells it that <object>
elements can't have arbitrary (‘expando’) properties set on them, and jQuery's data()
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:
jQuery.noData= {};
at some point before calling animate
.
Upvotes: 9