Tip: you can modify some code before running
Javascript page floating images (advertising effect)<html><head><meta http-equiv="content-type" content="text/html; charset=gb2312" /><title>Javascript page floating images (advertising effect)</title></head><body><div id=img1 style="z-index: 100; left: 2px; width: 59px; position: absolute; top: 43px; height: 61px; visibility: visible;"></div></body></html><script type="text/javascript">Var xpos = 300; var ypos = 200; var step = 1; var delay = 30; var height = 0; var hoffset = 0; var woffset = 0; var yon = 0; var xon = 0; var pause = true; var interval; img1.style. top = ypos; function changepos () {width = document. body. clientwidth; height = document. body. clientheight; hoffset = img1.offsetheight; woffset = img1.offsetwidth; img1.style. left = xpos + document. body. scrollleft; img1.style. top = ypos + document. body. scrolltop; if (yon) {ypos = ypos + step;} else {ypos = ypos-step;} if (ypos <0) {yon = 1; ypos = 0 ;} if (ypos> = (height-hoffset) {yon = 0; ypos = (height-hoffset);} if (xon) {xpos = xpos + step ;} else {xpos = xpos-step;} if (xpos <0) {xon = 1; xpos = 0;} if (xpos >=( width-woffset )) {xon = 0; xpos = (width-woffset) ;}} function start () {img1.visibility = "visible"; interval = setinterval ('changepos () ', delay );} function pause_resume () {if (pause) {clearinterval (interval); pause = false;} else {interval = setinterval ('changepos () ', delay ); pause = true ;}} start ();</script>
Tip: you can modify some code before running