假設在我的樣式表:我該如何檢測jQuery的css值?
.test{width: 20px; height: 50px; color: blue;}
.some-test{padding: 20px; margin: 10px;}
.even-test{font-size: 20px; color: red;}
是否有可能檢測每個CSS屬性的20px
值,這樣我可以更換呢?
我假定檢測是這樣的:
$('.selector').filter(function() {
return $(this).css(property) === '20px';
}).css(property, value);
是不是有什麼事情是這樣的:style.arguments[]
?
['的.css()'](http://api.jquery.com/css/) - 谷歌是你的朋友。這適用於給出這個類的元素。 – Christoph
儘管一個元素被賦予了這樣的類,但只能檢測到它。 –
您無法使用jQuery –