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

Widget:追放信息:修订间差异

来自OGAS数据中枢
弃权者留言 | 贡献
无编辑摘要
弃权者留言 | 贡献
撤销弃权者讨论)的修订版本18827
 
第1行: 第1行:
<script>
<script>
(function() {
(function() {
     $('.xb-skin-btn').click(function(e) {
     function initExileInfobox() {
        e.stopPropagation();
        document.querySelectorAll('.xb').forEach(function(box) {
        $(this).toggleClass('open');
            if (box.dataset.initialized) return;
        $('.xb-overlay').toggleClass('open');
            box.dataset.initialized = 'true';
    });
            var btn = box.querySelector('.xb-skin-btn');
    $(document).click(function(e) {
            var overlay = box.querySelector('.xb-overlay');
        if (!$(e.target).closest('.xb-overlay').length && !$(e.target).closest('.xb-skin-btn').length) {
            var curName = box.querySelector('.xb-cur-name');
             $('.xb-skin-btn').removeClass('open');
            var items = box.querySelectorAll('.xb-skin-item');
            $('.xb-overlay').removeClass('open');
            var imgs = box.querySelectorAll('.xb-img-item');
        }
             var intros = box.querySelectorAll('.xb-intro-item');
    });
            if (!btn || !overlay) return;
    $('.xb-skin-item').click(function() {
            btn.addEventListener('click', function(e) {
        var $this = $(this);
                e.stopPropagation();
        if ($this.hasClass('on')) return;
                var isOpen = overlay.classList.toggle('open');
        $('.xb-skin-item').removeClass('on');
                btn.classList.toggle('open', isOpen);
        $this.addClass('on');
            });
        var idx = $this.index();
            items.forEach(function(item) {
        $('.xb-img-item').removeClass('on').eq(idx).addClass('on');
                item.addEventListener('click', function() {
        var name = $this.attr('data-name') || '';
                    var idx = item.getAttribute('data-idx');
        var intro = $this.attr('data-intro') || '';
                    items.forEach(function(el) { el.classList.remove('on'); });
        $('.xb-cur-name').text(name);
                    imgs.forEach(function(el) { el.classList.remove('on'); });
         $('.xb-cur-text').html(intro);
                    intros.forEach(function(el) { el.classList.remove('on'); });
     });
                    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 && curName) {
                        curName.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:55的最新版本

<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 curName = box.querySelector('.xb-cur-name');
           var items = box.querySelectorAll('.xb-skin-item');
           var imgs = box.querySelectorAll('.xb-img-item');
           var intros = box.querySelectorAll('.xb-intro-item');
           if (!btn || !overlay) return;
           btn.addEventListener('click', function(e) {
               e.stopPropagation();
               var isOpen = overlay.classList.toggle('open');
               btn.classList.toggle('open', isOpen);
           });
           items.forEach(function(item) {
               item.addEventListener('click', function() {
                   var idx = item.getAttribute('data-idx');
                   items.forEach(function(el) { el.classList.remove('on'); });
                   imgs.forEach(function(el) { el.classList.remove('on'); });
                   intros.forEach(function(el) { el.classList.remove('on'); });
                   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 && curName) {
                       curName.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>