jQuery .find() not working in IE
I have a function trying to run this:
if ( action=='fadeIn' ) {
if ( $( this ).css( 'position' ) == "static" ) {
$( this ).css( {position: 'relative'} );
}
$( this ).append( '<span class="bg_fad开发者_运维技巧e">' )
}
var fader = $( this ).find( '.bg_fade' );
alert(fader.attr('class'));
It works fine in Firefox, but in IE, the alert returns undefined. Any ideas?
The whole code is at http://www.jakelauer.com/jquery/bgFade/jquery.bgFade.js
Being used at jakelauer.com/jquery/bgFade
It's almost certainly the fact that IE stops processing on errors somewhere else in the script. Press F12 to bring up developer tools, go to Script, and press Start debugging. Then reload your page. You'll find your error in a hurry.
EDIT:
I took a closer look. Try closing your <span>
tag in your append
. The append is not going off in IE.
精彩评论