How to edit CSS class via jQuery if statement -
i have if statement checks url "ivnt", div "carriage-promo" have height changed it's dafault of 0px, 40px.
i not want add class or remove class, know how achieve , doesn't solve problem i'm afraid.
consider:
$(document).ready(function () { if(window.location.href.indexof("invt") > -1) { $('#promo-carriage').css{ height: '40px'} } });
however, not working me. suggestions? i'm quite sure syntax error, i'm new jquery/js!
use parenteses .css()
, height
inside quote.
$(document).ready(function () { if(window.location.href.indexof("invt") > -1) { $("#promo-carriage").css("height", "40px"); } });
Comments
Post a Comment