DIV 特效问题 如何动态生成 DIV 背景色为 蓝色 中心有个按钮,并且 该DIV 是由页面中心 逐渐 变大 到整个屏幕,然后 点击 DIV 上的按钮 在 逐渐变小 到中心点 到消失 ?在线等 源码 ,谢谢~! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><script>var bflag=true;var timer;function ff(){ //document.write(escape(document.form1.tt.value)); var obj=document.getElementById("d"); if(bflag) { obj.style.left=obj.offsetLeft-5; obj.style.top =obj.offsetTop-5; obj.style.width =obj.clientWidth+10; obj.style.height =obj.clientHeight+10; } else { obj.style.left=obj.offsetLeft+5; obj.style.top =obj.offsetTop+5; obj.style.width =obj.clientWidth-10; obj.style.height=obj.clientHeight-10; } if(obj.clientWidth>1000) { bflag=false; clearTimeout(timer); return; } if(obj.clientWidth<=0) { bflag=true; clearTimeout(timer); return; } timer=setTimeout("ff()", 100);}</script></head><body><div id="d" style="background:#0099FF; position:absolute; width:300px; height:300px; left:100px; top:100px"></div><div style="position:absolute; left:230px; top:230px; background:#CCCCCC;"><input type="button" value="clieck" onClick="ff();"></div></body></html> <html> <head> <script> var bflag=false; var timer; var time ;function ff(){bflag?bflag=false:bflag=true;aa();}function aa() { //document.write(escape(document.form1.tt.value)); var obj=document.getElementById("d"); if(bflag) { obj.style.left=obj.offsetLeft-5; obj.style.top =obj.offsetTop-5; obj.style.width =obj.clientWidth+10; obj.style.height =obj.clientHeight+10; } else { obj.style.left=obj.offsetLeft+5; obj.style.top =obj.offsetTop+5; obj.style.width =obj.clientWidth-10; obj.style.height=obj.clientHeight-10; } if(obj.clientWidth>1000) { bflag=false; clearTimeout(timer); return; } if(obj.clientWidth <=0) { bflag=true; clearTimeout(timer); return; } timer=setTimeout("aa()", 100); } function stop1(){clearTimeout(timer);}</script> </head> <body> <div id="d" style="background: #CC3399; position:absolute; width:300px; height:300px; left:550px; top:250px"> </div> <div style="position:absolute; left:700px; top:400px; background:#CCCCCC;"> <input type="button" value="start" onClick="ff();"> <input type="button" value="stop" onClick="stop1();"></div> </body> </html> js 函数怎么实现这样的功能 js 中 parent.scroll(x,y)中的参数什么意思,请教了 帮忙看看CSS Sprites哪里写错了 请高手赐教,怎样才可以调用js效果?? 请问这段js代码是什么意思 javascript可不可以调用Windows的颜色选择框(WinForm中有这个功能) 关于图片坐标问题,有一点点难度。 菜鸟提问,别笑我。 请指教:关于计数器的做法 关于利用javascript调用outlook express的问题 这个效果是如何实现!跪求啊! jscript在IE下运行正常但到firefox下就死掉了
<head>
<script>
var bflag=true;
var timer;
function ff()
{
//document.write(escape(document.form1.tt.value));
var obj=document.getElementById("d");
if(bflag)
{
obj.style.left=obj.offsetLeft-5;
obj.style.top =obj.offsetTop-5;
obj.style.width =obj.clientWidth+10;
obj.style.height =obj.clientHeight+10;
}
else
{
obj.style.left=obj.offsetLeft+5;
obj.style.top =obj.offsetTop+5;
obj.style.width =obj.clientWidth-10;
obj.style.height=obj.clientHeight-10;
}
if(obj.clientWidth>1000)
{
bflag=false;
clearTimeout(timer);
return;
}
if(obj.clientWidth<=0)
{
bflag=true;
clearTimeout(timer);
return;
}
timer=setTimeout("ff()", 100);
}
</script>
</head>
<body>
<div id="d" style="background:#0099FF; position:absolute; width:300px; height:300px; left:100px; top:100px">
</div>
<div style="position:absolute; left:230px; top:230px; background:#CCCCCC;"><input type="button" value="clieck" onClick="ff();"></div></body>
</html>
<head>
<script>
var bflag=false;
var timer;
var time ;
function ff(){
bflag?bflag=false:bflag=true;
aa();
}function aa()
{
//document.write(escape(document.form1.tt.value));
var obj=document.getElementById("d");
if(bflag)
{
obj.style.left=obj.offsetLeft-5;
obj.style.top =obj.offsetTop-5;
obj.style.width =obj.clientWidth+10;
obj.style.height =obj.clientHeight+10;
}
else
{
obj.style.left=obj.offsetLeft+5;
obj.style.top =obj.offsetTop+5;
obj.style.width =obj.clientWidth-10;
obj.style.height=obj.clientHeight-10;
}
if(obj.clientWidth>1000)
{
bflag=false;
clearTimeout(timer);
return;
}
if(obj.clientWidth <=0)
{
bflag=true;
clearTimeout(timer);
return;
}
timer=setTimeout("aa()", 100);
}
function stop1(){
clearTimeout(timer);
}
</script>
</head>
<body>
<div id="d" style="background: #CC3399; position:absolute; width:300px; height:300px; left:550px; top:250px">
</div>
<div style="position:absolute; left:700px; top:400px; background:#CCCCCC;">
<input type="button" value="start" onClick="ff();"> <input type="button" value="stop" onClick="stop1();"></div> </body>
</html>