有没有办法可以清理这个jquery css的变化?像所有css更改的东西都在一个.css()
$('#container img')
.css("opacity","1")
.css("width","339px")
.css("height", "211px");
Run Code Online (Sandbox Code Playgroud)
我会添加一个CSS类.
$('#container img').addClass("foo");
Run Code Online (Sandbox Code Playgroud)
哪里
.foo{
opacity: 1;
width: 399px;
height: 211px;
}
Run Code Online (Sandbox Code Playgroud)
这种技术称为有状态CSS,对于操作UI非常有用:http://timgthomas.com/2012/05/mute-your-asynchronous-uis-with-stateful-css/
| 归档时间: |
|
| 查看次数: |
37 次 |
| 最近记录: |