I would like to execute an animation when the page loads but only when a css attribute has a value of something. The animation works fine without the if statement. Here is my code:
$(document).ready(function() {
if($("h1").css('font-size') == '36px'){
$("h1").animate({
"font-size" : "20px"
}, 750);
}
});
console.log($("h1").css('font-size'));what does it show?h1elements are in the page