2012-06-24 41 views

回答

1

我之前使用过jQuery Cycle Plugin。它支持预览加载图片并预加载图片。它有很多不错的功能。我不确定你是否可以控制高度/ witdh,但我认为如果你把一个CSS溢出属性的周围股利。

例如使用一些小的修改,基本演示,你可以找到关于 http://jquery.malsup.com/cycle/basic.html

在这种情况下,它是唯一的CSS样式我已经改变了:-)

<!DOCTYPE html> 
<html> 
<head> 
    <title>JQuery Cycle Plugin - Basic Demo</title> 
    <style type="text/css"> 
     .slideshow { height: 160px; width: 160px; margin: auto; overflow: auto } 
     .slideshow img { } 
    </style> 
    <!-- include jQuery library --> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
    <!-- include Cycle plugin --> 
    <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script> 
    <script type="text/javascript"> 
     $(document).ready(function() { 
      $('.slideshow').cycle({ 
       fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... 
      }); 
     }); 
    </script> 
</head> 
<body> 
    <div class="slideshow"> 
     <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200" /> 
     <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200" /> 
     <img src="http://cloud.github.com/downloads/malsup/cycle/beach3.jpg" width="200" height="200" /> 
     <img src="http://cloud.github.com/downloads/malsup/cycle/beach4.jpg" width="200" height="200" /> 
     <img src="http://cloud.github.com/downloads/malsup/cycle/beach5.jpg" width="200" height="200" /> 
    </div> 
</body> 
</html> 

查看更多在他们的主页上: http://jquery.malsup.com/cycle/