36
个编辑
-
汇聚密码安全智慧 共享实战经验!
无编辑摘要 标签:移动版编辑 移动版网页编辑 |
无编辑摘要 标签:移动版编辑 移动版网页编辑 |
||
| 第117行: | 第117行: | ||
lis.each(function() { | lis.each(function() { | ||
var $li = $(this); | var $li = $(this); | ||
// | // 使用 attr 设置 style 属性,确保样式优先级最高 | ||
var styleStr = 'width: ' + containerWidth + 'px !important; ' + | |||
'height: 25px !important; ' + | |||
'line-height: 25px !important; ' + | |||
'list-style: none !important; ' + | |||
'float: left !important; ' + | |||
'display: inline-block !important; ' + | |||
'box-sizing: border-box !important; ' + | |||
'padding: 0 !important; ' + | |||
'margin: 0 !important; ' + | |||
'vertical-align: top !important; ' + | |||
'flex-shrink: 0 !important; ' + | |||
'white-space: nowrap !important; ' + | |||
'overflow: visible !important; ' + | |||
'text-overflow: clip !important; ' + | |||
'text-align: center !important; ' + | |||
'word-break: keep-all !important; ' + | |||
'word-wrap: normal !important; ' + | |||
'max-width: ' + containerWidth + 'px !important; ' + | |||
'position: relative !important;'; | |||
$li.attr('style', styleStr); | |||
// 确保所有子元素(包括 strong、a、font 等)都不会换行 | // 确保所有子元素(包括 strong、a、font 等)都不会换行 | ||
$li.find('*'). | $li.find('*').each(function() { | ||
'white-space | var $elem = $(this); | ||
$elem.attr('style', | |||
'white-space: nowrap !important; ' + | |||
'display: inline !important; ' + | |||
'text-align: center !important;' | |||
); | |||
}); | }); | ||
}); | }); | ||
| 第230行: | 第226行: | ||
ul.css('width', totalWidth + 'px'); | ul.css('width', totalWidth + 'px'); | ||
lis.each(function() { | lis.each(function() { | ||
$(this) | var $li = $(this); | ||
var styleStr = 'width: ' + containerWidth + 'px !important; ' + | |||
'white-space: nowrap !important; ' + | |||
'overflow: visible !important; ' + | |||
'text-overflow: clip !important; ' + | |||
'text-align: center !important;'; | |||
$li.attr('style', styleStr); | |||
}); | }); | ||