I am struggling with an if statement that checks the url for "invt". My goal is to change the height of the div "promo-carriage" from its default value of 0px to 40px.
I want to accomplish this without adding or removing a class. I already know how to do it using those methods, but they don't solve my current problem.
Please have a look at the code below:
$(document).ready(function () {
if (window.location.href.indexOf("invt") > -1) {
$('#promo-carriage').css({
height: '40px'
});
}
});
Unfortunately, this code snippet isn't working as expected for me. Can anyone provide any suggestions? I suspect it might be a syntax error, but I'm fairly new to jQuery/JS!