求一脚本动画 本帖最后由 z578410840 于 2012-12-31 22:41:13 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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=utf-8" /><title>无标题文档</title><script type="text/javascript"> function init(){ var button=document.getElementById("test"); button.onclick=show; } function show(){ this.onclick=null; var information={ position:"absolute", left:"0px", top:"0px", width:"200px", height:"200px" } var img=document.createElement("img"); img.src="1.gif"; for(var i in information){ img.style[i]=information[i]; } document.body.appendChild(img); var screenX=document.documentElement.clientWidth||document.body.clientWidth; var screenY=document.documentElement.clientHeight||document.body.clientHeight; var d=parseInt(screenX/screenY)+1; move(img,this,d,screenY-200); } function move(img,button,d,y){ img.style.left=parseInt(img.style.left)+d+"px"; img.style.top=parseInt(img.style.top)+1+"px"; var p=window.setTimeout(function(){move(img,button,d,y)},10); if(parseInt(img.style.top)>=y){ window.clearTimeout(p); img.parentNode.removeChild(img); button.onclick=show; } } window.onload=init;</script></head><body><input type="button" value="show" id="test" /></body></html>大体这样试试 要正好到右下角貌似的仔细计算一下图片和屏幕的长宽才可以 web开发-正则表达式 如何实现图片浏览特效js代码的重复调用? 好心的大哥帮忙用js写个自适应高度div JS位置问题 如何将字符串中的运算符及数字分别提取出来并存到数组中 这双击问题出在哪里 这个怎样统计输入的字数??在线等! 我在表单里有两个单选钮:()男 ()女 我如何用javascript判断用户一个也没选? 声明: 高分求弹出菜单教程,要求源码结构清晰,效果较好.想要多少分,都可以给你加上.... 关于jquery ui 中tabs的问题? 请高手帮忙看哈,一下面这段代码的意思。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function init(){
var button=document.getElementById("test");
button.onclick=show;
}
function show(){
this.onclick=null;
var information={
position:"absolute",
left:"0px",
top:"0px",
width:"200px",
height:"200px"
}
var img=document.createElement("img");
img.src="1.gif";
for(var i in information){
img.style[i]=information[i];
}
document.body.appendChild(img);
var screenX=document.documentElement.clientWidth||document.body.clientWidth;
var screenY=document.documentElement.clientHeight||document.body.clientHeight;
var d=parseInt(screenX/screenY)+1;
move(img,this,d,screenY-200);
}
function move(img,button,d,y){
img.style.left=parseInt(img.style.left)+d+"px";
img.style.top=parseInt(img.style.top)+1+"px";
var p=window.setTimeout(function(){move(img,button,d,y)},10);
if(parseInt(img.style.top)>=y){
window.clearTimeout(p);
img.parentNode.removeChild(img);
button.onclick=show;
}
}
window.onload=init;
</script>
</head><body>
<input type="button" value="show" id="test" />
</body>
</html>
大体这样试试 要正好到右下角貌似的仔细计算一下图片和屏幕的长宽才可以