网页上图片跳动

来源:互联网 发布:ubuntu怎么安装jdk1.8 编辑:程序博客网 时间:2024/05/01 02:57
<!DOCTYPE html><html><head><title>跳动</title><script type="text/javascript">function fun() {document.getElementById("pf").style.top = Math.random() * 500;document.getElementById("pf").style.left = Math.random() * 500;setTimeout("fun();", 1000);}</script><style>#pf {position: absolute;left: 20px;top: 30px;}</style></head><body onload="fun();"><div id="pf"><img src="piaofu.jpg" /></div></body></html>
注意:只能在 IE中实现   现在 大部分浏览器 不兼容


原创粉丝点击