I wanted to hide the element which have calc css3:
nav{width: calc(100% - 20px); height: 50%;}
I tried this:
$('*').filter(function() {
return $(this).css('width') == 'calc';
}).css("display","none");
But seems wrong way to do?
demo
css method returns the computed value of the properties, you should read and filter the initial CSS rules:
var s = document.styleSheets[1], // the second stylesheet (for jsfiddle)
rules = s.cssRules,
selector = [],
l = rules.length;
for ( var i = 0; i < l; i++ ) {
if ( rules[i].style['width'].indexOf('calc') > -1 ) {
selector.push( rules[i].selectorText );
}
}
$( selector.join() ).hide();
http://jsfiddle.net/webozine/9EZ3k/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With