-

汇聚密码安全智慧 共享实战经验!

  • 我们目前有643个页面,13个用户,731次编辑。

MediaWiki:Mobile.js:修订间差异

跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
标签已被回退 移动版编辑 移动版网页编辑
无编辑摘要
标签已被回退
第53行: 第53行:
         });
         });
          
          
         // 设置每个 li 的宽度
         // 设置每个 li 的宽度和样式(防止换行)
         lis.css({
         lis.each(function() {
            'width': containerWidth + 'px',
            var $li = $(this);
            'height': '25px',
            // 先设置宽度,确保不换行
            'line-height': '25px',
            $li.css({
            'list-style': 'none',
                'width': containerWidth + 'px',
            'float': 'left',
                'height': '25px',
            'display': 'inline-block',
                'line-height': '25px',
            'box-sizing': 'border-box',
                'list-style': 'none',
            'padding': '0 10px',
                'float': 'left',
            'vertical-align': 'top',
                'display': 'inline-block',
            'flex-shrink': '0'
                'box-sizing': 'border-box',
                'padding': '0 10px',
                'vertical-align': 'top',
                'flex-shrink': '0',
                'white-space': 'nowrap',
                'overflow': 'hidden',
                'text-overflow': 'ellipsis',
                'text-align': 'center'
            });
         });
         });
          
          
第142行: 第150行:
             var totalWidth = containerWidth * lis.length;
             var totalWidth = containerWidth * lis.length;
             ul.css('width', totalWidth + 'px');
             ul.css('width', totalWidth + 'px');
             lis.css('width', containerWidth + 'px');
             lis.each(function() {
                $(this).css({
                    'width': containerWidth + 'px',
                    'white-space': 'nowrap',
                    'overflow': 'hidden',
                    'text-overflow': 'ellipsis',
                    'text-align': 'center'
                });
            });
              
              
             var currentLeft = parseInt(ul[0].dataset.left) || 0;
             var currentLeft = parseInt(ul[0].dataset.left) || 0;
第218行: 第234行:
         var promptAdded = initUserPrompt();
         var promptAdded = initUserPrompt();
          
          
         // 延迟初始化滚动效果,确保 DOM 完全更新
         // 延迟初始化滚动效果,确保 DOM 完全更新和样式应用
         setTimeout(function() {
         setTimeout(function() {
            // 再次确保所有 li 都有正确的样式(防止换行)
            var siteNoticeScroll = $('#siteNoticeScroll');
            if (siteNoticeScroll.length) {
                var ul = siteNoticeScroll.find('ul:first');
                if (ul.length) {
                    var lis = ul.find('li');
                    var containerWidth = siteNoticeScroll.width() || siteNoticeScroll[0].offsetWidth || siteNoticeScroll[0].clientWidth;
                    if (containerWidth > 0) {
                        lis.each(function() {
                            var $li = $(this);
                            $li.css({
                                'white-space': 'nowrap',
                                'overflow': 'hidden',
                                'text-overflow': 'ellipsis',
                                'text-align': 'center'
                            });
                        });
                    }
                }
            }
             initSiteNoticeScroll();
             initSiteNoticeScroll();
         }, promptAdded ? 100 : 0);
         }, promptAdded ? 200 : 100);
     }
     }
      
      

导航菜单