I need to be able to fade between classes and seamlessly transition any and all styles being applied to the element and its children. How can this be done using jQuery? I know how to add/remove classes but that is not the same as a nice transition between two drastically different colors.
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- What uses more memory in c++? An 2 ints or 2 funct
- Adding a timeout to a render function in ReactJS
- Include empty value fields in jQuery .serialize()
jQuery UI has a toggleClass function that has an argument for duration:
http://jqueryui.com/demos/toggleClass/
For example, I do this on one of my sites (fade in/out the
light
class and fade/in out thedark
class):Is this what you're trying to accomplish? Here's the jsFiddle
HTML:
jQuery:
CSS:
Check out the color plugin for jQuery: https://github.com/jquery/jquery-color
Try fadeIn.
http://api.jquery.com/fadeIn/
Although depending on the complexity you may need jQuery UI as other have mentioned.