Widget:GameSwitcher:修订间差异
来自OGAS数据中枢
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第137行: | 第137行: | ||
applyFadeColor(); | applyFadeColor(); | ||
// var firstActive = document.querySelector( '#gf-homepage .gf-tab.active' ); | |||
// if ( firstActive ) { | |||
// setTimeout( function () { moveIndicator( firstActive ); }, 50 ); | |||
// } | |||
var firstActive = document.querySelector( '#gf-homepage .gf-tab.active' ); | |||
if ( firstActive ) { | |||
setTimeout( function () { | |||
var switcher = document.getElementById( 'gf-switcher' ); | |||
var sr = switcher.getBoundingClientRect(); | |||
var tr = firstActive.getBoundingClientRect(); | |||
console.log( 'switcher left:', sr.left ); | |||
console.log( 'tab left:', tr.left ); | |||
console.log( 'tab width:', firstActive.offsetWidth ); | |||
console.log( 'calculated offset:', tr.left - sr.left ); | |||
console.log( 'indicator:', document.getElementById( 'gf-tab-indicator' ) ); | |||
moveIndicator( firstActive ); | |||
}, 50 ); | |||
} | |||
tabs.forEach( function ( tab ) { | tabs.forEach( function ( tab ) { | ||
tab.addEventListener( 'click', function () { | tab.addEventListener( 'click', function () { | ||
2026年6月20日 (六) 23:18的版本
少女前线系列多游戏首页切换Widget。调用方式:{{#widget:GameSwitcher}}