var width = window.screen.width; var left=(width-352)/2; TabListItem1.style.marginLeft=left+"px";
可以,不过window.screen没测试不知道是否支持,最好改为var width =Math.max(document.documentElement.clientWidth,document.body.clientWidth)
http://www.2cto.com/kf/201505/397949.html