SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Wolf_22's Avatar
    Join Date
    Jul 2005
    Posts
    1,710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question jQuery issue with addClass and removeClass in IE 9...

    In the following snippet of code, I'm trying to use addClass and removeClass to do some stuff with a tiny slider menu. As per IE9's "Developer Tools", I can't seem to notice the class change take effect. Can someone explain to me why?

    Code:
    $('.content-bottom .toggle').click(function(){
    
       if($(this).hasClass('close')){
          console.log('a');
          $('.content-bottom').animate({right: 0},'slow');
          $(this).removeClass('close');//DOES NOT WORK IN IE9
          $(this).addClass('open');//DOES NOT WORK IN IE9
          return false;
       }
                    
       if($(this).hasClass('open')){
          console.log('b');
          $('.content-bottom').animate({right:initialLegendRight}, 'slow');
          $(this).removeClass('open');//DOES NOT WORK IN IE9
          $(this).addClass('close');//DOES NOT WORK IN IE9
          return false;
       }
    
    });

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    IE's current developer tools don't have real time updates to show attribute changes and what not, you need to hit the small refresh icon in the top left of the developer tools in order to see a change occur. IE11 will come with this feature but until it's released to the world we're stuck with what we have.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •