v26110452 大家都在关注头像轮换:三条合起来每 3~9 秒随机换一个
This commit is contained in:
21
js/gch/v6.js
21
js/gch/v6.js
@@ -6,9 +6,9 @@
|
||||
(function () {
|
||||
var sec = document.getElementById('gcHome');
|
||||
if (!sec) return;
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110451';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110452';
|
||||
document.head.appendChild(l);
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110451';
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110452';
|
||||
s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */
|
||||
document.body.appendChild(s);
|
||||
|
||||
@@ -151,17 +151,16 @@
|
||||
im.className = 'sw-o';
|
||||
setTimeout(function () { im.src = lkSrc(nx); im.className = 'sw-i'; }, 220);
|
||||
}
|
||||
/* 11-05 用户:「动的太频繁了,三个文章加一起,每 3~9 秒随机动一个」→ 不再每条各自计时:全局一个计时器,每 3~9 秒随机挑一条(前 3 条里)换一个头像 */
|
||||
function likeTick() {
|
||||
likeT.forEach(clearTimeout); likeT = [];
|
||||
[0, 1, 2].forEach(function (i) {
|
||||
(function loop() {
|
||||
likeT[i] = setTimeout(function () {
|
||||
var r = list.querySelectorAll('.g6-nt')[i];
|
||||
if (r && !document.hidden && list.offsetParent) swapOne(r);
|
||||
loop();
|
||||
}, 2000 + Math.random() * 4000);
|
||||
})();
|
||||
});
|
||||
(function loop() {
|
||||
likeT[0] = setTimeout(function () {
|
||||
var rs = list.querySelectorAll('.g6-nt'), i = Math.floor(Math.random() * Math.min(3, rs.length));
|
||||
if (rs[i] && !document.hidden && list.offsetParent) swapOne(rs[i]);
|
||||
loop();
|
||||
}, 3000 + Math.random() * 6000);
|
||||
})();
|
||||
}
|
||||
all.addEventListener('click', function () { location.href = 'guangchang/' + location.search + location.hash; });
|
||||
paintList();
|
||||
|
||||
Reference in New Issue
Block a user