只对css类进行动画处理,没有显式样式
Using JQuery animate I would like to operate with css classes, defined somewhere in .css file, not to have to give all styles params to jquery.animate() explicitly.
使用JQuery animate我希望使用.css文件中某处定义的css类来操作,而不必显式地将所有样式params赋予JQuery .animate()。
I can create a fake (e.g. invisible) element with such a class, read its css properties and give them to jquery.animate() - does anybody know a better way?
我可以用这样的类创建一个伪元素(例如,看不见的),读取它的css属性,并将它们交给jquery.animate()—有人知道更好的方法吗?
4 个解决方案
#1
78
The jQueryUI provides a extension to animate
function that allows you to animate css class.
jQueryUI提供了一个动画函数的扩展,允许您动画css类。
edit: Example here
编辑:例子
There are also methods to add/remove/toggle class which you might also be interested in.
还有一些方法可以添加/删除/toggle类,您可能也会感兴趣。
更多相关文章
- 有什么方法可以让jQuery循环在到达终点或开始时不循环?
- js限制文本框只能输入数字方法
- 模拟JQuery的Ready方法实现并出现的问题
- html 页面内锚点定位及跳转方法总结
- 是否有更快的方法来遍历HTMLDocument中的每一个元素呢?
- Jquery-如何使用prop方法更改backgroundColor?
- 关于 客户端发现响应内容类型为“text/html; charset=utf-8”,但
- HTML5 Canvas 绘图方法整理 【十五、Canvas页面交互: 鼠标事件 】
- 不会出现Javascript context.closePath()方法