jquery自动切换淡入淡出效果的例子

发布时间:2020-09-20编辑:脚本学堂
分享一个jquery实现自动切换效果,即淡入淡出效果的代码,jquery实现淡入淡出的方法,需要的朋友参考下。

例子,jquery淡入淡出效果代码。
 

复制代码 代码示例:
<!DOCTYPE html>
<html>
<head>
<title>jquery自动切换淡入淡出效果_www.jb200.com</title>
<style type="text/css">
.slideshow { height: 232px; width: 232px; margin: auto }
.slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; }
</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="/malsup/cycle/beach1.jpg" width="200" height="200" />
  <img src="/malsup/cycle/beach2.jpg" width="200" height="200" />
  <img src="/malsup/cycle/beach3.jpg" width="200" height="200" />
  <img src="/malsup/cycle/beach4.jpg" width="200" height="200" />
  <img src="/malsup/cycle/beach5.jpg" width="200" height="200" />
 </div>
</body>
</html>