Floating images on the screen

Source: Internet
Author: User
Tip: you can modify some code before running

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Floating images on the screen</title></head><body><center><!-- script --><script language="javascript">Window. onload = netease; var brOK = false; var mie = false; var aver = parseInt (navigator. appVersion. substring (0, 1); var aname = navigator. appName; function checkbrOK () {if (aname. indexOf ("Internet Explorer ")! =-1) {if (aver> = 4) brOK = navigator. javaEnabled (); mie = true;} if (aname. indexOf ("Netscape ")! =-1) {if (aver> = 4) brOK = navigator. javaEnabled () ;}} var vmin = 2; var vmax = 5; var vr = 2; var timer1; function Chip (chipname, width, height) {this. named = chipname; this. vx = vmin + vmax * Math. random (); this. vy = vmin + vmax * Math. random (); this. w = width; this. h = height; this. xx = 0; this. yy = 0; this. timer1 = null;} function movechip (chipname) {if (brOK) {eval ("chip =" + chipname); if (! Specified ument. body. offsetHeight;} chip. xx = chip. xx + chip. vx; chip. yy = chip. yy + chip. vy; chip. vx + = vr * (Math. random ()-0.5); chip. vy + = vr * (Math. random ()-0.5); if (chip. vx> (vmax + vmin ) Chip. vx = (vmax + vmin) * 2-chip.vx; if (chip. vx <(-vmax-vmin) chip. vx = (-vmax-vmin) * 2-chip.vx; if (chip. vy> (vmax + vmin) chip. vy = (vmax + vmin) * 2-chip.vy; if (chip. vy <(-vmax-vmin) chip. vy = (-vmax-vmin) * 2-chip.vy; if (chip. xx <= pageX) {chip. xx = pageX; chip. vx = vmin + vmax * Math. random ();} if (chip. xx >=pagex + pageW-chip.w) {chip. xx = pageX + pageW-chip.w; chip. vx =-vmin-vmax * Math. random ();} if (chip. yy <= pageY) {chip. yy = pageY; chip. vy = v Min + vmax * Math. random ();} if (chip. yy> = pageY + pageH-chip.h) {chip. yy = pageY + pageH-chip.h; chip. vy =-vmin-vmax * Math. random ();} if (! Mie) {eval ('document. '+ chip. named + '. top = '+ chip. yy); eval ('document. '+ chip. named + '. left = '+ chip. xx);} else {eval ('document. all. '+ chip. named + '. style. pixelLeft = '+ chip. xx); eval ('document. all. '+ chip. named + '. style. pixelTop = '+ chip. yy);} chip. timer1 = setTimeout ("movechip ('" + chip. named + "')", 100) ;}} function stopme (chipname) {if (brOK) {// alert (chipname) eval ("chip =" + chipname ); if (chip. timer1! = Null) {clearTimeout (chip. timer1) }}var netease; var chip; function netease () {checkbrOK (); netease = new Chip ("netease", 60, 80); if (brOK) {movechip ("netease ");}}</script><div id="netease" ><ahref="#" target="_blank"><dd></dd></div><!-- end of flying button 2--><table border="0" cellPadding="0" cellSpacing="0" width="110%"> <tr> <td width="84%"></td> </tr></table><table border="0" cellPadding="2" width="648"> <tr align="middle"> <td class="cur" height="18" width="640"><font COLOR="#000000" face="黑体" size="5">Floating images on the screen</font></td> </tr></table><table width="66%" height="147"> <tr> <td width="78%" bgcolor="#FFFF00" height="106"><font face="仿宋_GB2312" size="3">I often see pictures floating freely on the Internet, from one side to the other side, and return after the border. This kind of freely floating picture seems very fashionable now, if you open Sohu, Netease, and other websites, you can see the pictures on the web page. Do you want to know how to do this? It's very simple. This is the effect of layer movement. Now, you can also easily achieve the above results with just a short piece of code!</font></td> </tr> <tr> </tr></table><table width="114%"> <tr> </tr></table></center></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.