$(function () { var $box = $(".box"); var head = []; var allW = document.body.clientWidth || document.documentElement.clientWidth; var wid = $box.eq(0).outerWidth(); var rol = Math.floor(allW/wid) $("#main").css({"width":wid*rol + "px", "margin":"0 auto"}); for(var i=0;i