var _headerwidth = $('#header').width();
var _foabgwidth = $('#page-body-inner').width();
console.log(_headerwidth);
console.log(_foabgwidth);
$('.static').css("width",_foabgwidth + "px");
$('.fixed').css("width",_headerwidth + "px");
var staticwidth = $('.static').width();
console.log('staticwidth:'+staticwidth);
Using the above code, my console logs are as follows
940
676
staticwidth:null
I'm trying to set the width for .static and fixed and I'm unable to get it to work using the jQuery I've used.
staticexists in the DOM at the point of execution?$('.static').css('width')give you?