打开/关闭菜单
26
6675
46
1.2万
OGAS数据中枢
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

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() {
     function initExileInfobox() {
     $('.xb-skin-btn').click(function(e) {
        document.querySelectorAll('.xb').forEach(function(box) {
        e.stopPropagation();
            if (box.dataset.initialized) return;
        $(this).toggleClass('open');
            box.dataset.initialized = 'true';
        $('.xb-overlay').toggleClass('open');
            var btn = box.querySelector('.xb-skin-btn');
    });
            var overlay = box.querySelector('.xb-overlay');
    $(document).click(function(e) {
            var curText = box.querySelector('.xb-cur-text');
        if (!$(e.target).closest('.xb-overlay').length && !$(e.target).closest('.xb-skin-btn').length) {
            var items = box.querySelectorAll('.xb-skin-item');
             $('.xb-skin-btn').removeClass('open');
             var imgs = box.querySelectorAll('.xb-img-item');
             $('.xb-overlay').removeClass('open');
            var intros = box.querySelectorAll('.xb-intro-item');
        }
             if (!btn || !overlay) return;
    });
            btn.addEventListener('click', function(e) {
    $('.xb-skin-item').click(function() {
                e.stopPropagation();
        var $this = $(this);
                var isOpen = overlay.classList.toggle('open');
        if ($this.hasClass('on')) return;
                btn.classList.toggle('open', isOpen);
        $('.xb-skin-item').removeClass('on');
            });
        $this.addClass('on');
            items.forEach(function(item) {
        var idx = $this.index();
                item.addEventListener('click', function() {
        $('.xb-img-item').removeClass('on').eq(idx).addClass('on');
                    var idx = item.getAttribute('data-idx');
        var name = $this.attr('data-name') || '';
                    items.forEach(function(el) { el.classList.remove('on'); });
        var intro = $this.attr('data-intro') || '';
                    imgs.forEach(function(el) { el.classList.remove('on'); });
        $('.xb-cur-name').text(name);
                    intros.forEach(function(el) { el.classList.remove('on'); });
         $('.xb-cur-text').html(intro);
                    item.classList.add('on');
     });
                    if (imgs[idx]) imgs[idx].classList.add('on');
                    if (intros[idx]) intros[idx].classList.add('on');
                    var nameEl = item.querySelector('.xb-skin-item-name');
                    if (nameEl && curText) {
                        curText.textContent = nameEl.textContent;
                    }
                    overlay.classList.remove('open');
                    btn.classList.remove('open');
                });
            });
            document.addEventListener('click', function(e) {
                if (!overlay.contains(e.target) && e.target !== btn) {
                    overlay.classList.remove('open');
                    btn.classList.remove('open');
                }
            });
         });
    }
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', initExileInfobox);
     } else {
        initExileInfobox();
    }
})();
})();
</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>