<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({handle:"slideTo",speed:300});