<! Doctype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title> document </title> <yoy> .box2 {} .box2 {width: 200px; Altura: 200px; Antecedentes: vermelho; Radio de fronteira: 50%; posição: relativa;} .Box3 {Width: 800px; Altura: 500px; borda: 1px vermelho sólido;} </style> </ading> <body> <botão type = "" id = "start"> 开始 </button> <button type = "" id = "stop"> 停止 </button> <div> <div id = "box"> </div> </div> </body> <script type = "text/javascript"> var tb = 300; var i = 0; var j = 0; var box = document.getElementById ('caixa'); var start = document.getElementById ('start'); var stop = document.getElementById ('stop'); start.OnClick = function () {start.style.display = 'nenhum'; 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) {t 0 tb = 300; } </script> </html>以上就是小编为大家带来的 JavaScript 广告移动特效的实现代码全部内容了 , 希望大家多多支持武林网 ~