我试图暗示一次淡入以下功能,但我正在努力如何将两者合并而没有错误。任何帮助表示赞赏!
var callOnce = true;
function aperture() {
if ((media.duration - media.currentTime) < 90)
if (callOnce) {
sync();
callOnce = false;
}
}
function sync() {
"use strict";
// Fade function here
}
setInterval(aperture, 100);
淡入淡出功能:
var s = document.getElementById('media').style;
s.opacity = 1;
(function fade() {
(s.opacity -= .1) < 0.1 ? s.opacity = 0 : setTimeout(fade, 40)
})();