实现多张图片浮动的效果
来源:互联网 发布:如何去痘印 知乎 编辑:程序博客网 时间:2024/04/28 05:18
<!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=gb2312" />
<title>实现多个图片浮动的效果</title>
<style type="text/css">
img{
position:absolute;
filter:alpha(opacity=100);
-moz-opacity:1;
opacity: 1;}
</style>
</head>
<body onload="float()">
<img src="../1.jpg" width="200" style="z-index:2;filter:alpha(opacity=10);-moz-opacity:0.1;" />
<img src="../1.jpg" width="200" style="z-index:3;filter:alpha(opacity=20);-moz-opacity:0.2;" />
<img src="../1.jpg" width="200" style="z-index:4;filter:alpha(opacity=30);-moz-opacity:0.3;" />
<img src="../1.jpg" width="200" style="z-index:5;filter:alpha(opacity=40);-moz-opacity:0.4;" />
<img src="../1.jpg" width="200" style="z-index:6;filter:alpha(opacity=50);-moz-opacity:0.5;" />
<img src="../1.jpg" width="200" style="z-index:7;filter:alpha(opacity=60);-moz-opacity:0.6;" />
<img src="../1.jpg" width="200" style="z-index:8;filter:alpha(opacity=70);-moz-opacity:0.7;" />
<img src="../1.jpg" width="200" style="z-index:9;filter:alpha(opacity=80);-moz-opacity:0.8;" />
<img src="../1.jpg" width="200" style="z-index:10;filter:alpha(opacity=90);-moz-opacity:0.9;" />
<img src="../1.jpg" width="200" style="z-index:11;" onmouseover="clearTimeout(a);" onmouseout="a=setTimeout(float,40);" />
</body>
</html>
<script language="javascript" type="text/javascript">
var imgs=document.images;
var xSpeed=new Array();
var ySpeed=new Array();
var x=new Array();
var y=new Array();
for(var i=0;i<imgs.length;i++){
xSpeed[i]=3;ySpeed[i]=3;
y[i]=i*15;x[i]=i*15;
}
var w=document.documentElement.clientWidth-200,h=document.documentElement.clientHeight-300;
function float(){
for(var i=0;i<imgs.length;i++){
if(x[i]>w|x[i]<0){ xSpeed[i]= -xSpeed[i];}
if(y[i]>h|y[i]<0){ ySpeed[i]= -ySpeed[i];}
x[i]=x[i]+xSpeed[i];
y[i]=y[i]+ySpeed[i];
imgs[i].style.left=x[i]+"px";
imgs[i].style.top=y[i]+"px";
}
a=setTimeout("float()",50);
}
</script>
- 实现多张图片浮动的效果
- 实现多张图片的浮动代码
- 多张图片的浮动
- 多张图片的浮动
- js实现图片浮动的效果
- js 实现一个图片浮动的效果
- JavaScript实现图片的浮动效果
- JavaScript实现图片的浮动效果
- 使用TransitionDrawable实现多张图片淡入淡出的效果
- js实现多张图片切换效果
- 利用window对象实现一个图片的浮动效果
- Android之图片浮动随意拖拽的效果实现
- Unity鼠标悬停实现图片的浮动效果
- 使用TransitionDrawable实现两张图片的过渡效果
- 使用TransitionDrawable实现两张图片的过渡效果
- javascript 实现多张图片轮流展示效果
- javascript实现多张图片轮流展示效果代码
- JS实现图片随机浮动效果
- MySQL计划任务之三
- List去重
- Android实现打电话的功能-使用Intent和AndroidManifset.xml中加入权限
- 从PHP判断浏览器的请求是否是一个ajax请求谈到$_SERVER
- firefox英文字符串不自动换行问题的解决方法
- 实现多张图片浮动的效果
- ruby入门_实例变量
- android AppWidget娱乐小应用
- 美术绘画学习
- android 在源码中编译工程的方法
- 要开始自己写一些算法了
- nginx ssl的安装和配置
- ppk和pem文件互转
- 基于 Android NDK 的学习之旅-----Android.mk 介绍