最初の 2 つのリンクは動作中の回転アイコンを示していますが、動作させたい 3 番目のリンクは正しく動作しません...
https://jsfiddle.net/752tfqyu/17/
私が作成した JSfiddle は動作します。JSfiddle 内のすべてのコンテンツを取得してサーバーでテストしたとき: 動作しません: http://cdubach.com/inc/test.php
http://cdubach.com/pages/home/index.php 問題があるところ、アイコンが回転しません。
アイコンを回転させるために使用されるメインの Javascript/Jquery。
/* [(START)Rotate Icon:SCroll Down] ----------------> */
$(document).ready(function() {
$(window).scroll(function() {
if ($(window).scrollTop() < 300) {
$("#rotate").css({
"top": $(window).scrollTop() + "px"
});
}
});
});
/* [(END)Rotate Icon:SCroll Down] ------------------> */
var looper;
var degrees = 0;
function rotateAnimation(el, speed) {
var elem = document.getElementById(el);
if (navigator.userAgent.match("Chrome")) {
elem.style.webkitTransform = "\"rotate(" + degrees + "deg)\"";
} else {
elem.style.transform = "\"rotate(" + degrees + "deg)\"";
}
looper = setTimeout('rotateAnimation(\'' + el + '\',' + speed + ')', speed);
degrees++;
if (degrees > 359) {
degrees = 1;
}
}