I can't figure out what I'm doing wrong here.
So I want to use jquery to check if a css class's property value is equal to something. If it is, then execute some code and if not execute some other code.
The issue is that some of it will work and others will not. For example here is my jquery:
if (jQuery( ".mobile_swap" ).css('height') == '100%' ){
console.log("worked");
} else {
console.log("nope");
}
Now it does not work but if I change it to this:
if (jQuery( ".mobile_swap" ).css('height') == '100px' ){
console.log("worked");
} else {
console.log("nope");
}
it will work. So my question is why does it recognize the px's but not the percentages? It also will not work with auto. Obviously, when I test for this I'm making sure that the css part is correct so it would be true.
Thanks in advance!
console.log()