用VML制作的会上下动的笑脸,还是非常酷的,不可错过哟

- 中国WEB开发者网络 (http://www.webasp.net)
-- 网页特效 (http://www.webasp.net/javascript/)
--- 用VML制作的会上下动的笑脸,还是非常酷的,不可错过哟 (http://www.webasp.net/javascript/1/722.htm)
-- 发布日期: 2005-07-01
<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<center><font color=red face="隶书" size=6>VML赏析六</font></center>
<BR>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<!--
<v:polyline style="position:relative" Points="0,0 100,100 400,100 400,300">
<v:stroke dashstyle="Dot" EndArrow="Classic"/>
</v:polyline>

//-->
<script>
function downShap()
{
var obj = event.srcElement;

obj.Shadow.on = "false";

obj.upx = obj.style.pixelLeft;
obj.upy = obj.style.pixelTop;

with(obj.style)
{
pixelLeft += 10;
pixelTop += 10;
}
}

function upShap()
{
var obj = event.srcElement;

obj.Shadow.on = "true";

with(obj.style)
{
pixelLeft = obj.upx;
pixelTop = obj.upy;
}
}




function downball()
{
var judger = ball.style.pixelTop + 4;

if(judger<=200)
{
ball.style.pixelTop = judger;
}
else
{

var ifup = ball.style.pixelHeight - 4;

if(ifup>=80)
{
ball.style.pixelHeight = ifup;
ball.style.pixelTop += 2;
ball.style.pixelWidth += 2;
}
else
{
setTimeout("upball()",10);
return;
}
}

setTimeout("downball()",10);

}

function upball()
{

var judger = ball.style.pixelHeight + 4;

if(judger<=100)
{
ball.style.pixelHeight = judger;
ball.style.pixelTop -= 2;
ball.style.pixelWidth -= 2;
}
else
{
var ifdown = ball.style.pixelTop - 4;

if(ifdown>= 80)
{
ball.style.pixelTop = ifdown;
}
else
{
ball.style.pixelTop = 80;

setTimeout("downball()",10);
return;
}
}

setTimeout("upball()",10);
}

function window.onerror()
{
return true;
}

</script>
<v:RoundRect style="position:absolute; left:100; top:100; width: 100; height:60; cursor: hand" onmouseover="downShap()" onmouseout="upShap()">
<v:Shadow on="true" / type = "single" color="#b3b3b3" offset="10px,10px"/>
<v:TextBox inset="5px,5px,5px,5px" style="font-size:10pt; color:#000000; font-family: Arial Black">Button</v:TextBox>
</v:RoundRect>

<v:Oval id="ball" style="position:absolute; left: 300; top:80; width:100; height:100;">
<v:TextBox inset="5px,5px,5px,5px" style="font-size:25pt; color:#000000; font-family: Arial Black">^_^</TextBox>
</v:Oval>
<script>
upball()
</script>


webasp.net