Widget:追放信息:修订间差异
来自OGAS数据中枢
更多操作
创建页面,内容为“<script> (function() { function initExileInfobox() { document.querySelectorAll('.xb').forEach(function(box) { if (box.dataset.initialized) return; box.dataset.initialized = 'true'; var btn = box.querySelector('.xb-skin-btn'); var overlay = box.querySelector('.xb-overlay'); var curText = box.querySelector('.xb-cur-text'); var items = box.querySelectorAll('.xb-skin-item');…” |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
<script> | <script> | ||
(function() { | (function() { | ||
$('.xb-skin-btn').click(function(e) { | |||
e.stopPropagation(); | |||
$(this).toggleClass('open'); | |||
$('.xb-overlay').toggleClass('open'); | |||
}); | |||
$(document).click(function(e) { | |||
if (!$(e.target).closest('.xb-overlay').length && !$(e.target).closest('.xb-skin-btn').length) { | |||
$('.xb-skin-btn').removeClass('open'); | |||
$('.xb-overlay').removeClass('open'); | |||
} | |||
}); | |||
$('.xb-skin-item').click(function() { | |||
var $this = $(this); | |||
if ($this.hasClass('on')) return; | |||
$('.xb-skin-item').removeClass('on'); | |||
$this.addClass('on'); | |||
var idx = $this.index(); | |||
$('.xb-img-item').removeClass('on').eq(idx).addClass('on'); | |||
var name = $this.attr('data-name') || ''; | |||
var intro = $this.attr('data-intro') || ''; | |||
$('.xb-cur-name').text(name); | |||
$('.xb-cur-text').html(intro); | |||
}); | |||
} | |||
})(); | })(); | ||
</script> | </script> | ||
2026年5月27日 (三) 22:53的版本
<script> (function() {
$('.xb-skin-btn').click(function(e) {
e.stopPropagation();
$(this).toggleClass('open');
$('.xb-overlay').toggleClass('open');
});
$(document).click(function(e) {
if (!$(e.target).closest('.xb-overlay').length && !$(e.target).closest('.xb-skin-btn').length) {
$('.xb-skin-btn').removeClass('open');
$('.xb-overlay').removeClass('open');
}
});
$('.xb-skin-item').click(function() {
var $this = $(this);
if ($this.hasClass('on')) return;
$('.xb-skin-item').removeClass('on');
$this.addClass('on');
var idx = $this.index();
$('.xb-img-item').removeClass('on').eq(idx).addClass('on');
var name = $this.attr('data-name') || ;
var intro = $this.attr('data-intro') || ;
$('.xb-cur-name').text(name);
$('.xb-cur-text').html(intro);
});
})(); </script>