<! DocType html> <html lang = "en"> <kopf> <meta charset = "utf-8"> <title> document </title> <style> .box2 {} .box2 {width: 200px; Höhe: 200px; Hintergrund: Rot; Border-Radius: 50%; Position: Relativ;} .box3 {Breite: 800px; Höhe: 500px; Rand: 1PX Solid Red;} </style> </head> <body> <button type = "" id = "start"> 开始 </button> <button type = "" id = "stop"> 停止 </button> <div> <div id = "box> </div> </div> </body> <Script =" Text/Javascript "> var lr = 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) {tb) {tb) {Tb = 0; J. J. J. Jl =}} if (j> tb) {tb) {{tb = 0; j. tb = 300; } </script> </html>以上就是小编为大家带来的 JavaScript 广告移动特效的实现代码全部内容了 , 希望大家多多支持武林网 ~