0

我正在尝试创建一个我已经完成的幻灯片(图像)(通过处理一个示例并稍微更改它,但我正在尝试适应图像大小,以便没有滚动选项。我试着把它在一个 div 中,但这不起作用(无疑是由于我的无能)。我在这里查了很多,发现有几个人问相同/相似的问题(例如如何调整图像大小以适应浏览器窗口? ),但是一直无法应用。目前我查看这个时,页面大小是最大图像的大小(当图像大于页面时)。

非常感谢您的帮助。

这是我目前所在的位置:

<!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>
4

1 回答 1

1

http://jsfiddle.net/LsNV7/6

.slideshow > img {width: 100%;}
于 2013-02-03T02:49:15.710 回答