JQuery用户界面删除类动画显得非功能 [英] JQuery UI remove class animations appear non functional
问题描述
我使用了一系列的CSS3过渡,但对老年人machinges备份使用JQuery用户界面添加和删除类。
I am using a series of CSS3 transitions but for older machinges back up by using JQuery UI add and remove class.
JQuery用户界面addClass动画是功能齐全。 JQuery用户界面removeClass移除但不是动画它们,而不是拖延的动画时间,然后跳转到previous类的属性。
JQuery UI addClass animations are fully functional. JQuery UI removeClass however are not animating they are instead delaying for the animation time and then jumping to the attributes of the previous class.
$('.box').addClass('adds', 800); ANIMATING CORRECTLY
$('.box').removeClass('adds', 800); NOT ANIMATING AT ALL
.box {
background:#CCC;
border:1px solid #222;
height:200px;
width:200px;
}
.adds {
height:220px !important;
width:400px !important;
}
我已成立了一个小提琴,但由于某种原因,这个小提琴确实什么都没有,不知道为什么。 http://jsfiddle.net/aA9LN/4/
任何想法?
奇妙
推荐答案
看起来 removeClass移除
不喜欢!重要
关键字。这里是jsbin演示: http://jsbin.com/idorud
It seems like removeClass
doesn't like the !important
keyword. Here is a demo on jsbin: http://jsbin.com/idorud
您可能希望以某种方式重写,比方说,删除!重要
关键字 .adds
类,并添加特异性的CSS选择器,例如: #someId div.adds
。
You may want to somehow rewrite the .adds
class by, say, removing the !important
keyword and add specificity to the css selector, e.g. #someId div.adds
.
这篇关于JQuery用户界面删除类动画显得非功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!