<!doctype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title> document> document </title> <style> .box2 {} .box2 {width:200px;高さ:200px;背景:赤; Border-radius:50%; Position:relative;} .box3 {width:800px;高さ:500px;ボーダー:1px固体赤;} </style> </head> <body> <button type = "" id = "start">开始</button> <button type = "" stop ">停止</button> <div> <div> div>" box "> </div> </div> </body> <script =" text/javascript "> var = 600; var tb = 300; var i = 0; var j = 0; var box = document.getElementById( 'box'); var start = document.getElementById( 'start'); var stop = document.getElementById( 'Stop'); start.onclick = function(){start.style.display = 'none'; stop.style.display = 'inline'; var time = setInterval(function(){box.style.left = i+'px'; box.style.top = j+'px'; if(i> lr){lr = 0; i-;} if(i <= lr){lr = 600; i ++;} if(j> tb = 0; j-; TB = 300; } </script> </html>以上就是小编为大家带来的javascript广告移动特效的实现代码全部内容了、希望大家多多支持武林网〜