开发者

can mootools change the attribute of a css .class so that the change is reflected across all elements that belong to that class?

开发者 https://www.devze.com 2022-12-31 14:45 出处:网络
similar to to this here... http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html

similar to to this here...

http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html

i know i can change each element's style's individually, but i want to change a lot of elements styles at the same time,开发者_高级运维 and the browser seems to struggle over about 40 elements.

thanks :)


Yes it can, quite easily.

$$('.someClass').addClass('newClass');

This will add newClass to every someClass element - in your case the 40 elements you have.

This is the literal answer to your question.

That said, I believe what you're really trying to do is generate a specific CSS class on the fly.

And that's something far more complicated. I suggest using this MooTools plugin: http://mootools.net/forge/p/moocss

0

精彩评论

暂无评论...
验证码 换一张
取 消