网站首页没有一点动画怎么可以,我以前用过Flash As3做过图片切换,效果非常不错,可是麻烦,改变起来麻烦。一直都想自己做个图片切换效果,总认为比较麻烦,今天自己实践了一下,其实还比较简单。不过有个小问题,IE8不兼容模式下 设置有透明效果的div 样式添加失效了,但是我用谷歌,IE8兼容测试都ok。
<!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>
<title>图片切换</title>
<script src="jquery-1.8.0.js" type="text/javascript"></script>
<link href="picchange.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="picMain">
<div class="picimg" id="divImg">
<img src="images/pic1.jpg" class="pic" />
<img src="images/pic2.jpg" class="pic" />
<img src="images/pic3.jpg" class="pic" />
<img src="images/pic4.jpg" class="pic" />
<img src="images/pic5.jpg" class="pic" />
<img src="images/pic6.jpg" class="pic" />
<img src="images/pic7.jpg" class="pic" />
<img src="images/pic8.jpg" class="pic" />
</div>
<div class="picaction" id="divLink">
<a href="images/pic8.jpg" title="8" onclick=" return picChange(8)" class="">8</a> <a href="images/pic7.jpg" title="7" onclick=" return picChange(7)">7</a> <a href="images/pic6.jpg" title="6"
onclick=" return picChange(6)">6</a> <a href="images/pic5.jpg" title="5" onclick=" return picChange(5)">
5</a> <a href="images/pic4.jpg" title="4" onclick=" return picChange(4)">4</a>
<a href="images/pic3.jpg" title="3" onclick=" return picChange(3)">3</a> <a href="images/pic2.jpg"
title="2" onclick=" return picChange(2)">2</a> <a href="images/pic1.jpg" title="1"
onclick=" return picChange(1)" class="">1</a>
</div>
<div id="picremark" class="picRemark">
测试介绍文件了啊</div>
</div>
</body>
</html>