$(()=>{ //原始模板跟着可以升级或修改 //出问题可以联系 764250069 // if(document.querySelectorAll('img').length>0){ // document.querySelectorAll('img').forEach(e=>{ // if(e.title){ // console.log(e.title) // console.log(e) // console.log('---------------------------') // } // }) // } // 屏蔽哪些名称 if( document.querySelectorAll('img').length > 0){ pingbi(document.querySelectorAll('img'),'图片名称') pingbi(document.querySelectorAll('img'),'Picture Name') } // 国际化查所有图片title // imggjuname() // 检测图片title //imgname('图片名称') // pingbi('图片名称') // 检测a标签的空链接 // jac() //console.log('21212121212121') // alert(12121212) if(document.querySelectorAll('.a799').length > 0){ ahref(document.querySelectorAll('.a799')) } // 拓展功能 tuozhan() // if(document.querySelector('.imgbigbox')){ // init(document.querySelector('.imgbigbox').children) // } }) // 拓展功能 function tuozhan(){ nava(document.querySelectorAll('.p_level1Box')) if(document.querySelectorAll('[data-title="img05"]')[0]){ threetwe(document.querySelectorAll('[data-title="img05"]'),0.5) setInterval(()=>{ threetwe(document.querySelectorAll('[data-title="img05"]'),0.5) },1000) } if(document.querySelectorAll('[data-title="img07"]')[0]){ threetwe(document.querySelectorAll('[data-title="img07"]'),0.7) setInterval(()=>{ threetwe(document.querySelectorAll('[data-title="img07"]'),0.7) },1000) } if(document.querySelectorAll('[data-title="img10"]')[0]){ threetwe(document.querySelectorAll('[data-title="img10"]'),1) setInterval(()=>{ threetwe(document.querySelectorAll('[data-title="img10"]'),1) },1000) } if(document.querySelectorAll('img')[0]){ setInterval(()=>{ document.querySelectorAll('img').forEach(e=>{ e.classList.add('ts06') }) },1000) } } function ahref(objarr){ objarr.forEach(e=>{ let str = e.innerHTML // console.log(e.innerHTML)Power By str = str.replaceAll('中企动力','中企动力') str = str.replaceAll('上海','上海') str = str.replaceAll('Power By : www.300.cn','Power By : www.300.cn') e.innerHTML = str }) } function nava(obj){ console.log('头脚开始检查') let i = 0 obj.forEach(item=>{ item.querySelectorAll('a').forEach(e=>{ // e.href i++ if(e.href === 'javascript:;'){ console.log(e.innerText) } }) }) console.log(i) } // 回调检查a标签的javascript function jac(){ setTimeout(asd=>{ if(document.querySelectorAll('a').length>0){ document.querySelectorAll('a').forEach(e=>{ console.log(e.href) if(e.href === 'javascript:;'){ console.log(e) console.log('---------------------------') } }) } },1000) } // 检测图片title function imgname(str){ if(document.querySelectorAll('img').length>0){ document.querySelectorAll('img').forEach(e=>{ e.classList.add('ts06') if(e.title === str){ e.title = '' e.alt = '' } }) } } // 国际化查所有图片title function imggjuname(){ if(document.querySelectorAll('img').length>0){ document.querySelectorAll('img').forEach(e=>{ if(e.title){ console.log(e.title) console.log(e) console.log('---------------------------') } }) } } // 屏蔽哪些名称 function pingbi(objarr,str){ objarr.forEach(e=>{ e.classList.add('ts06') // e.title === str ? e.title = '' : true, if (e.title === str) { e.title = '' e.alt = '' } }) } function threetwe(objarr,num){ objarr.forEach(e=>{ const w = e.offsetWidth const a = w * num e.style.height = a + 'px' }) } function init(objarr){ objarr[0].classList.add('bigobg') // console.log(objarr) for (let i = 0; i < objarr.length; i++) { objarr[i].onmouseover = function(){ for (let j = 0; j < objarr.length; j++) { objarr[j].classList.remove('bigobg') } // console.log(this) this.classList.add('bigobg') } } }