Jake
Jake

Reputation: 4234

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_fade">' )
 }
 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

Upvotes: 2

Views: 10149

Answers (1)

Plynx
Plynx

Reputation: 11461

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.

Upvotes: 3

Related Questions