JQuery cross-server issue

I have this code that works fine in all browsers, but not in IE6, and I don't know why, can anyone shed some light on this?

$("#handle").toggle( function () { $('#login').animate({ marginTop: '0', }, 1000); $("#handle").addClass('opened'); return false; }, function () { $('#login').animate({ marginTop: '-280', }, 1000); $("#handle").removeClass('opened'); return false; } ); 
+6
javascript jquery cross-browser internet-explorer-6
source share
3 answers

You have commas in object literals passed in animate() . IE does not support this. This should work:

 $('#login').animate({ marginTop: '0' //No comma, can you see it? }, 1000); 
+11
source share

Yes, probably I can.

SOUND COMMA You have it!

 marginTop: '0', // remove comma 

and

 marginTop: '-280', // remove comma 

Trailing commas are a big NoNo in IE.

+10
source share

Also should not be

 "-280px" // added "px" 
+1
source share

All Articles