#main { position:relative; margin:0 auto; width:700px; height:200px; overflow:hidden; } #left { position:absolute; display:block; width:25px; height:25px; text-align:center; top:100px; left:0; z-index:666; background:red; font-size:18px; line-height:25px; } #right { position:absolute; z-index:666; font-size:18px; line-height:25px; text-align:center; display:block; top:100px; right:0; background:green; width:25px; height:25px; } #pan { width:3300px; height:300px; float:left; left:-700px; position:absolute; position:absolute; overflow:hidden; } #pan img { float:left; width:300px; height:300px; }
这样可以让用户自由的控制轮播图的方向