Skip to main content

Search and Top Navigation

#6697 closed feature (wontfix)

Opened November 25, 2010 08:13PM UTC

Closed November 26, 2010 02:48AM UTC

new setClass effect (with use cases)

Reported by: pangel Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.effects.core Version: 1.8.6
Keywords: Cc:
Blocked by: Blocking:
Description

Pull request: https://github.com/jquery/jquery-ui/pull/56

Original pull message:

Input fields in ajax forms often have multiple visual states, usually stored in css classes such as .default, .invalid, .modified, etc.

I could not find an easy way to animate those input fields from their current state to any new class. addClass does not remove the current classes. switchClass requires knowledge of the other classes (introducing code duplication). Doing $(elem).attr('class','').addClass('myClass'); transitions from the default style rather than from the current style.

With the patch you can do : $(elem).setClass('myClass','slow');

Let me know if I missed a simple way to do that.

Attachments (0)
Change History (1)

Changed November 26, 2010 02:48AM UTC by scottgonzalez comment:1

resolution: → wontfix
status: newclosed

Use .switchClass( .attr( "class" ), newClass )