Mark D. Lincoln schrieb: > > I have found a couple of fixes for the problem of using toggleClass > and removeClass in Internet Explorer (IE). It seems the root of the > problem is that when you have multiple classes assigned to the > className property of an element in IE (“class1 class2”) and you > remove one of the classes from the className property, you can be left > with a className property containing classes with leading spaces (“ > class2”). What is even worse, if you remove both classes multiple > times, you can end up with the className property containing just > blank spaces (“ “). It is these leading spaces which are causing > toggleClass and removeClass to fail with multiple classes assigned to > the className property. This problem does not seem to exist in Firefox > since it seems to remove leading and trailing spaces when the > className property is changed. > Hi Mark,
I tested your fix. While it worked for IE, Opera did fail even with removing a single class, with or without your fix. My solution, that I added to subversion and at least works with FF1.5, IE6 and Opera9, does not use a regular expression at all. Please check if this fix is a solution for your particlar problem. If not, it would be great if you could provide additional tests. -- Jörn _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/