$(function(){ if($(window).innerWidth()< 768){ $('.product-list-page li').each(function(){ if($(this).text() == '首页' || $(this).text() == '末页'){ $(this).remove() } }) } $('.news-list-ul').eq(0).css({display:'grid'}) $('.news-title').eq(0).css({display:'block'}) $('.news-title-box').eq(0).css({display:'block'}) $('.classify-title').click(function(){ $(this).addClass('classify-title-active') $(this).siblings().removeClass('classify-title-active') $('.news-list-ul').eq($(this).index()).css({display:'grid'}) $('.news-list-ul').eq($(this).index()).siblings().css({display:'none'}) $('.news-title-box').eq($(this).index()).css({display:'block'}) $('.news-title-box').eq($(this).index()).siblings().css({display:'none'}) }) if($(window).innerWidth()>= 768){ // 解决编辑器行高的问题 $('p[style*="line-height"]').each(function (index) { const num = $('p[style*="line-height"]')[index].attributes.style.value.split(':')[1].split('em')[0] $('p[style*="line-height"]').eq(index).css({'line-height':`${parseFloat(num)/10*2}rem`}) }); } else { $('p[style*="line-height"]').each(function (index) { const num = $('p[style*="line-height"]')[index].attributes.style.value.split(':')[1].split('em')[0] $('p[style*="line-height"]').eq(index).css({'line-height':`${parseFloat(num)/10*5}rem`}) }); } })