Opened 13 years ago

Closed 13 years ago

#6697 closed feature (wontfix)

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.

Change History (1)

comment:1 Changed 13 years ago by Scott González

Resolution: wontfix
Status: newclosed

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

Note: See TracTickets for help on using tickets.