В этой статье описывается метод управляющего слоя JS, создающего круговое движение. Поделитесь этим для вашей ссылки, следующим образом:
<! Doctype html public "-// w3c // dtd html 4.01 // en" "http://www.w3.org/tr/html4/strict.dtd"> content =" htmlet http-equiv = " Motion </title> <script type = "text/javascript"> window.onload = function () {var ctrlbtn = $ id ("ctrl"); var Ismove = true; om = null; ctrlbtn.onclick = function () {if (ismove) {movebycircle (); } else {clearInterval (om); } ismove =! Ismove; }} функция moveByCircle () {var bacl = parseint ($ id ("clockbac"). style.left); var bact = parseint ($ id ("clockbac"). style.top); var bacw = parseint ($ id ("clockbac"). Style.width); var bach = parseint ($ id ("clockbac"). Style.height); var initl = bacl+bacw/2; var initt = bact+bach/2; var step = 0; var r = 65; $ id ("tt"). style.left = initl+"px"; $ id ("tt"). style.top = initt+"px"; var l = parseint ($ id ("tt"). style.left); var t = parseint ($ id ("tt"). style.top); om = window.setInterval (function () {if (step == 360) {step = 1;} $ id ("tt"). style.left = (l + r * math.sin (step)) + "px"; $ id ("tt"). Style.top = (t - r * math.cos (step)) + "px"; step + = 3.14/30; d.gethours (); } функция $ id (id) {return document.getElementById (id); } </script> </head> <body> <div id = "tt" style = "width: 10px; высота: 10px; фон: красный; позиция: абсолют; верх: 105px; слева: 130px;"> </div> <input type = "id =" ctrl "style =" ширина: 100px; "../img/clock.jpg" id = "clockbac" style = "width: 200px; высота: 200px; top: 100px; слева: 100px; положение: абсолют; z-index: -999"/> </body> </html>For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of Алгоритмы и методы обхода JavaScript »и« Сводка использования математических операций JavaScript ».
Я надеюсь, что эта статья будет полезна для каждого программирования JavaScript.