我使用 jQuery Cycle,它非常简单。这是一个简单的标记:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<!-- 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() {
$('.transitionPictures').cycle({
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
});
</script>
</head>
<body>
<!-- TRANSITION SLIDESHOW -->
<div class="transitionPictures">
<img src="image01.jpg" width="400" height="300" alt="" />
<img src="image02.jpg" width="400" height="300" alt="" />
</div>
</body>
</html>
您可以访问jQuery Cycle 站点以获取更多选项以添加到准备好的脚本中。