解決したいことは、以下のpngのフレームアニメーションでIE11だけ、動きません。
他、chrome、safariなどは動作確認済みです。
ご教授いただけますでしょうか。
const $element = $j('.hanabira-anime'); const imagePath = '/dummy/'; const totalFrames = 100; const animationDuration = 10000; const timePerFrame = animationDuration / totalFrames; let timeWhenLastUpdate; let timeFromLastUpdate; let frameNumber = 1; function step(startTime) { if (!timeWhenLastUpdate) timeWhenLastUpdate = startTime; timeFromLastUpdate = startTime - timeWhenLastUpdate; // then we check if it is time to update the frame if (timeFromLastUpdate > timePerFrame) { // and update it accordingly $element.attr('src', imagePath + `img/hanabira/Par_hanabira${frameNumber}.png`); // reset the last update time timeWhenLastUpdate = startTime; // then increase the frame number or reset it if it is the last frame if (frameNumber >= totalFrames) { frameNumber = 1; } else { frameNumber = frameNumber + 1; } } requestAnimationFrame(step); } $j(document).ready(() => { for (var i = 1; i < totalFrames + 1; i++) { $j('body').append(`<div id="preload-image-${i}" style="background-image: url('${imagePath}img/hanabira/Par_hanabira${i}.png');"></div>`); } }); // wait for images to be downloaded and start the animation $j(window).on('load', () => { requestAnimationFrame(step); });
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/01/22 14:31
退会済みユーザー
2018/01/22 14:49
2018/01/22 14:52
退会済みユーザー
2018/01/22 15:14
2018/01/22 15:23
退会済みユーザー
2018/01/22 16:05
2018/01/22 22:55