开发者

jquery: Load CSS values for a class from the css file

I'm look for a way to search a .css style sheet for a class. The particular class would not have been assigned to any particular DOM element as of yet, it is simple in the style sheet.

I saw another thread which said I could use document.styleSheet, but this requires me to know which order the css file is loaded by the document and also which number the class is defined in the style sheet.

I'm just looking for something like:

var $cssClassHeight = $(document).loadCSS('myCl开发者_如何转开发ass', 'height');
var $cssClassWidth = $(document).loadCSS('myClass', 'width');

Anything out there like this, or am I going to have to assign it to a dummy div and then read it from it's attributes?

Thanks

Syn


This jQuery plugin allows you to change the properties of a CSS class, so maybe you could alter it to query them instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜