<div class="slider" id="slider"> <ul class="sliderbox"> <li> <a href=""><img src="images/1.jpg" alt="jQuery单张图片滚动"></a> </li> <li> <a href=""><img src="images/2.jpg" alt="jQuery单张图片滚动"></a> </li> <li> <a href=""><img src="images/3.jpg" alt="jQuery单张图片滚动"></a> </li> </ul> </div>
.slider{height:170px; margin:20px auto; overflow:hidden; position:relative;} .sliderbox{position:relative;}/*必须加这句css,否则向左右,上下滚动时会没有效果*/
$("#slider").powerSlider();