1

The following jQuery code works fine in FireFox but not in IE.

The loop executes the expected number of times(verified by counting alerts) but the hidden classes do not become visible.

 $("a.riskInformationButton").bind("click", function(e){ 
     var toggler = $(this).parent().parent().next();         
     while(!toggler.hasClass("spacerRow")){   
        alert("Hey!");             
        toggler = toggler.toggleClass("hidden").toggleClass("visible").next();         
    }
});

Any assistance with this issue would be much appreciated

Thanks,

Shawn

3
  • can you explain what you are trying to do in this line - `toggler = toggler.toggleClass("hidden").toggleClass("visible").next(); ?
    – Russ Cam
    Commented Sep 10, 2009 at 14:21
  • to toggle between showing and hiding, you don't need to use toggleClass. Use toggle() - docs.jquery.com/Effects/toggle
    – Russ Cam
    Commented Sep 10, 2009 at 14:23
  • You should improve your another question. Don't make the same question again. stackoverflow.com/questions/1404932/… Commented Sep 10, 2009 at 14:24

1 Answer 1

2

Are they table rows? jQuery has a bug about table-rows and toggle in IE8. Here's a workaround.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.