2013-02-03 88 views
0

我想创建一个幻灯片(图像),我已经做了(通过应对一个例子,并稍微改变它,但我试图适应图像大小如此没有选择滚动,我尝试把它放在一个div中,但这不起作用(无疑是由于我的无能)。我在这里查了很多,发现有几个人提出相同/类似的问题(例如How to resize an image to fit in the browser window?),但我一直无法应用它。目前当我查看这个时,页面大小是最大图像的大小(当图像大于页面时)。试图适合幻灯片宽度以适合屏幕

非常感谢您的帮助。

这里是我目前所在的地方:

<!DOCTYPE html> 
<html> 
<head> 
<title>JQuery Cycle Plugin - Basic Demo</title> 
<style type="text/css"> 
.slideshow { height: "100%"; width:auto } 
</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"; style= height: "100%"; width:"auto"> 
     <img src="1.jpg" /> 
     <img src="2.jpg" /> 
     <img src="3.jpg" /> 
     <img src="4.jpg" /> 
     <img src="5.jpg" /> 
</div> 
</body> 
</html> 
+0

摆弄:http://jsfiddle.net/LsNV7/4(更新)。请注意,你的风格语法需要帮助。样式声明中通常不使用引号。 – isherwood

回答