Skip to main content

Bug Tracker

Side navigation

#11883 closed bug (invalid)

Opened June 08, 2012 08:47PM UTC

Closed June 09, 2012 02:42PM UTC

Possible bug in toggleClass

Reported by: troels@animonk.dk Owned by: troels@animonk.dk
Priority: low Milestone: None
Component: css Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

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!!

Attachments (0)
Change History (3)

Changed June 08, 2012 11:16PM UTC by sindresorhus comment:1

owner: → troels@animonk.dk
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.

Changed June 09, 2012 10:11AM UTC by troels@animonk.dk comment:2

status: pendingnew

Take a look at this example:

http://jsfiddle.net/h7a2m/4/

Changed June 09, 2012 02:42PM UTC by sindresorhus comment:3

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.