Vml+Dhtml:小小的页面效果,叫它"淘气鬼"好了

来源:互联网 发布:策划网络活动方案 编辑:程序博客网 时间:2024/05/21 11:22
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<HTML xmlns:v>
<HEAD>
<META http-equiv='Content-Type' content='text/html;charset=gb2312'>
<Meta name='Gemeratpr' content='网络程序员伴侣(Lshdic)2004'>
<meta name="DownLoad URL" content="http://www.lshdic.com/downlshdic.asp">
<TITLE>淘气鬼</TITLE>
<STYLE>
v:*{behavior:url(#default#Vml);} //声明变量v为Vml对象
*{font-size:12px;color:;}
a{text-decoration:none;}
a:hover{color:red;}
</STYLE>
</HEAD>
<BODY topmargin='2' leftmargin='2' bgcolor=black style='border:1 solid green'>
<BASE target='_top'>
<TABLE id='' bgcolor='' cellspacing='2' cellpadding='2' border='1' width='300' height='300' style='color:white'>
<TR>
<TD>普通HTML内容</TD>
<TD>普通HTML内容</TD>
</TR>
<TR>
<TD>普通HTML内容</TD>
<TD>普通HTML内容</TD>
</TR>
</TABLE>
<v:Oval fillcolor='green' id=oval1 style='position:absolute;width:100;height:100;z-index:6'> <!--制作一个渐变形状-->
<v:Stroke color='white'/>  <!--这是边框可以不要-->
<v:fill type='gradientradial' opacity='0' color2='yellow' id='fill1'/>
</v:oval>
<script>
//原作:风云舞,载自http://www.lshdic.com/bbs
//没什么无聊写着玩,叫它淘气鬼好了,放在网页中也很有意思呵呵
var wid,hei //定义全局存储变量,主要为提高速度
wid=document.body.offsetWidth-50;hei=document.body.offsetHeight-50  //首次启动将宽与高放进变量
function document.onmousemove(){  //鼠标移动时
oval1.style.left=Math.abs(wid-event.x-50);oval1.style.top=Math.abs(hei-event.y-50); //物体位置
temp1=Math.round(100/(wid/event.x));temp2=Math.round(100/(hei/event.y)) //计算X与Y的百分比
fill1.focusposition=temp1+"%,"+temp2+"%";fill1.focussize=temp1/9+"%,"+temp2/9+"%";oval1.style.width=100+Math.abs(temp1-50);oval1.style.height=100+Math.abs(temp2-50) //更新物体形状
}
function window.onresize(){
wid=document.body.offsetWidth-50;hei=document.body.offsetHeight-50 //窗体改变大小时刷新变量
}
</script>
</BODY>
</HTML><script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>