Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11883 closed bug (invalid)

Possible bug in toggleClass

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: None
Component: css Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


Not sure if it's a bug or not, but it seems there's an issue with class order in the toggleClass function.

The function only works for me when the toggled class is loaded after the original class in the css.

Is that on purpose?

I've tried most recent version of jQuery.

P.S. I'm otherwise more than satisfied with jQuery. Great job guys!!

Change History (3)

comment:1 Changed 11 years ago by sindresorhus

Owner: set to [email protected]
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 11 years ago by [email protected]

Status: pendingnew

Take a look at this example:


comment:3 Changed 11 years ago by sindresorhus

Component: unfiledcss
Priority: undecidedlow
Resolution: invalid
Status: newclosed

If you inspect your HTML you can clearly see that the correct classes are applied. This is a problem with CSS specificity and not jQuery.

Note: See TracTickets for help on using tickets.