{loop $contents $i $content} document.writeln("
"); {$content[0]} document.writeln("
"); var delay = 30; var xPos = 20; var yPos = 20 + {intval($i)}*100; var step = 1; var height = 0; var Hoffset = 0; var Woffset = 0; var yon = 0; var xon = 0; var pause = true; var interval; adsimg{$ads[$i]['adsid']}.style.top = yPos; function changePos{$ads[$i]['adsid']}() { if (pause) { width = document.body.clientWidth; height = document.body.clientHeight; Hoffset = adsimg{$ads[$i]['adsid']}.offsetHeight; Woffset = adsimg{$ads[$i]['adsid']}.offsetWidth; adsimg{$ads[$i]['adsid']}.style.left = xPos + document.body.scrollLeft; adsimg{$ads[$i]['adsid']}.style.top = yPos + document.body.scrollTop + {$intval($i)}*100; {if $i==0} 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); } {/if} } } function phpcms_ads_fudong{$ads[$i]['adsid']}() { adsimg{$ads[$i]['adsid']}.visibility = "visible"; interval = setInterval('changePos{$ads[$i]['adsid']}()', delay); } phpcms_ads_fudong{$ads[$i]['adsid']}(); {/loop}