#container { margin:100px auto; width:800px; visibility:visible; overflow:hidden; z-index:2; } #con-ul { margin:0; padding:0; list-style-type:none; z-index:1; width:2410px; height:262px; } li { float:left; margin:0 5px; overflow:hidden; } img { display:block; border:1px solid red; width:255px; height:260px; }
// 判断left距离是否到了ul宽度的三分之二,如果是就把left设置为零 if (math.abs(parseint(conul.style.left)) === parseint(conul.offsetwidth * 2 / 3)) { conul.style.left = 0; }