引用任何一个版本的jquery文件。
将JoynBackground.css和JoynBackground.js引入文档中。
JS部分
$(document).ready(function(){
JoynBackground(2,10000); //运行(动画类型,时间)
//场景动画类型:1拉近 2拉远 3幻灯片显示
})4.DIV部分
<!-- 背景[就这么简单] --> <div id="JoynBackground"> <img src="图片地址" name="1"/> <img src="图片地址2" name="2"/> ……<!--多少张都可以系统会自动一张一张往下读--> </div> <!-- 背景 -->
下下来看一眼就懂了,超级简单……
所有版本浏览器都可以使用……
好好看可以给份不 ,42741361@qq.com
那样的话直接CSS就可以搞定了,写了个小事例,自己改改就行了
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.aa{ width: 200px; height: 200px; background-color: aqua; margin-left: auto; margin-right: auto; margin-top: 20%; }
#animation{
-webkit-animation:pulse 10s .2s ease both;
-moz-animation:pulse 10s .2s ease both;
-webkit-animation:pulse 10s .2s 1000 ease-in normal none ;
}
@-webkit-keyframes pulse{
0%{-webkit-transform:scale(1)}
50%{-webkit-transform:scale(1.5)}
100%{-webkit-transform:scale(1)}
}
@-moz-keyframes pulse{
0%{-moz-transform:scale(1)}
50%{-moz-transform:scale(1.5)}
100%{-moz-transform:scale(1)}
}
</style>
</head>
<body>
<div id="animation" class="aa"></div>
</body>
</html>