i have this site:
There is a difference when you call function in document.ready
calculation or resize function
There is a white border when the page loads calculation is not correct ...
$( document ).ready(function() {
var windowsize = $(window).outerWidth();
var stanga= jQuery('#secondary').outerWidth();
console.log('stanga:',stanga);
var dreapta= jQuery('.right').outerWidth();
console.log('dreapta:',dreapta);
var contentwh=windowsize-stanga-dreapta;
console.log('total:',contentwh);
$('.navbar-fixed-top').css('width',contentwh);
$('#main-content').css('width',contentwh);
$('.continut').css('width',contentwh);
$(window).on('resize',function(){
var windowsize = $(window).outerWidth();
var stanga= jQuery('#secondary').outerWidth();
console.log('stanga-resize:',stanga);
var dreapta= jQuery('.right').outerWidth();
console.log('dreapta-resize:',dreapta);
var contentwh=windowsize-stanga-dreapta;
console.log('total-resize:',contentwh);
$('.navbar-fixed-top').css('width',contentwh);
$('#main-content').css('width',contentwh);
$('.continut').css('width',contentwh);
}
});
Basically I used the same code and document.ready but also according to resize and unfortunately goes.
I did manual calculation on a 1366 px and ought to get a 669px width (good value) and I am 657px sites.
Does anyone know why this difference appears to 12px?
Thanks in advance!