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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -