Reputation: 397
I have this site:
CODE JS:
var windowsize = $(window).outerWidth();
$('#main-content').css('overflow','hidden');
console.log('latime:',windowsize);
var stanga= jQuery('#secondary').outerWidth();
console.log('stanga:',stanga);
var dreapta= jQuery('.right').outerWidth();
console.log('dreapta:',dreapta);
var contentwh=windowsize-stanga-dreapta;
$('#main-content').css('width',contentwh);
var content= jQuery('#main-content').outerWidth();
$('.navbar-fixed-top').css('width',contentwh);
My div (#main-content)
must be exactly as the remaining space.
Unfortunately to me is slightly larger look at the picture below ...
What is wrong with this calculation?
Upvotes: 1
Views: 97
Reputation: 789
Hi I got your Problem.
You haven't calculate padding of "secondary" div So Calculation is like for secondary div is
var stanga= jQuery('#secondary').outerWidth() + 30;
Hope this will solved your problem.
thanks.
Upvotes: 2