您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> 安卓开发 >> 正文

html5漂浮图片代码介绍

作者:佚名    责任编辑:admin    更新时间:    2015-10-21 14:20:43

大家看见慢慢升起的图片的时候是不是感觉很不错?下面我们给大家介绍一下html5漂浮图片代码吧!希望大家可以在这里学习!

<div id="point1" style="position:absolute;visibility:visible;"><!--Please delete this table and insert into your html elements--><table border="0" cellspacing="0" cellpadding="0"><tr><td><a ><img src=/uploadfile/2015/0730/20150730113718860.jpg" border="0"></a></td></tr><tr><td><center><a href=http://www.com><font face="Arial" size="2" color="#0000FF">网页特效</font></a></center></td></tr><tr><td><center><a href=http://www.com><font face="Arial" size="2" color="#0000FF">新增内容</font></a></center></td></tr></table><!--End of the customizable area, please do not delete div the tag --></div><script LANGUAGE="JavaScript1.2">var XX=20; // X position of the scrolling objectsvar xstep=1;var delay_time=60;//Begin of the unchangable area, please do not modify this areavar YY=0;  var ch=0;var oh=0;var yon=0;var ns4=document.layers?1:0var ie=document.all?1:0var ns6=document.getElementById&&!document.all?1:0if(ie){YY=document.body.clientHeight;point1.style.top=YY;}else if (ns4){YY=window.innerHeight;document.point1.pageY=YY;document.point1.visibility="hidden";}else if (ns6){YY=window.innerHeightdocument.getElementById('point1').style.top=YY}function reloc1(){if(yon==0){YY=YY-xstep;}else{YY=YY+xstep;}if (ie){ch=document.body.clientHeight;oh=point1.offsetHeight;}else if (ns4){ch=window.innerHeight;oh=document.point1.clip.height;}else if (ns6){ch=window.innerHeightoh=document.getElementById("point1").offsetHeight}if(YY<0){yon=1;YY=0;}if(YY>=(ch-oh)){yon=0;YY=(ch-oh);}if(ie){point1.style.left=XX;point1.style.top=YY+document.body.scrollTop;}else if (ns4){document.point1.pageX=XX;document.point1.pageY=YY+window.pageYOffset;}else if (ns6){document.getElementById("point1").style.left=XXdocument.getElementById("point1").style.top=YY+window.pageYOffset}}function onad(){if(ns4)document.point1.visibility="visible";loopfunc();}function loopfunc(){reloc1();setTimeout('loopfunc()',delay_time);}if (ie||ns4||ns6)window.onload=onad</script>

以上就是我们给大家介绍的html5漂浮图片代码了。希望大家继续关注我们的网站!