锘?(function () { wow = new WOW({ boxClass: "wow", animateClass: "animated", }); wow.init(); const navbar = document.getElementsByClassName("fixed-top-custom"); if (window.scrollY >= 1) { navbar[0].classList.add("min"); } // 鏇存敼瀵艰埅鏍忚儗鏅鑹 window.addEventListener("scroll", function () { if (window.scrollY >= 1) { navbar[0].classList.add("min"); } else { navbar[0].classList.remove("min") } //console.log(navbar[0].classList); }); //$('.header .navul li').mouseenter(function () { // var aimHeight = 130; // var items = $(this).find('.cnavul li').length; // if (items > 3) { // aimHeight = 260; // } // if (items > 6) { // aimHeight = 390; // } // //console.log($(this).find('li').length); // $(this).find('.cnavul').css('height', aimHeight); //}).mouseleave(function () { // $(this).find('.cnavul').css('height', '0'); //}); //$(".pagenav .towap").mouseenter(function () { // $(this).find('.viewwap').css('display', 'block'); //}).mouseleave(function () { // $(this).find('.viewwap').css('display', 'none'); //}); var defaultSKey = "璇疯緭鍏ュ叧閿瘝"; $("#srhsubmit").click(function () { toSearch(); }); function toSearch() { var txtkey = $("#srhkey").val(); if (txtkey.length < 1 || txtkey == defaultSKey) { alert(defaultSKey); return; } txtkey = escape(txtkey); var aimUrl = "/aspx/Search/SearchNews.aspx?Query=" + txtkey + "&Page=1"; document.location.href = aimUrl; } $("#srhkey").focusin(function () { var txtkey = $("#srhkey").val(); if (txtkey == defaultSKey) { $("#srhkey").val(""); } }); $("#srhkey").focusout(function () { var txtkey = $("#srhkey").val(); if (txtkey == "") { $("#srhkey").val(defaultSKey); } }); $("#srhkey").keydown(function (e) { if (e.keyCode == 13) { toSearch(); } }); var iWith = document.body.clientWidth;//window.screen.availWidth;//document.body.clientWidth; var curUrl = document.location.href; console.log(iWith); if (IsPcOpen()) { var oriStr = 'wap.sdcbcm.com'; if (curUrl.indexOf(oriStr) > -1) { document.location.href = curUrl.replace(oriStr, 'www.sdcbcm.com'); } } else { var oriStr = 'www.sdcbcm.com'; if (curUrl.indexOf(oriStr) > -1) { document.location.href = curUrl.replace(oriStr, 'wap.sdcbcm.com'); } } }); //backtotop.js $(function () { $(".lidiv .liacs").each(function () { var imgC = $(this).find('img').attr('src'); if (imgC.indexOf('listdefault.') > 0) { $(this).remove(); } }); var obj = document.getElementById("goTopBtn"); function getScrollTop() { return document.documentElement.scrollTop; } function setScrollTop(value) { document.documentElement.scrollTop = value; } if (obj != null) { window.onscroll = function () { getScrollTop() > 0 ? obj.style.display = "" : obj.style.display = "none"; } obj.onclick = function () { var goTop = setInterval(scrollMove, 10); function scrollMove() { setScrollTop(getScrollTop() / 1.1); if (getScrollTop() < 1) clearInterval(goTop); } } } }); //鍒ゆ柇鏄惁鏄疨C璁惧锛宼rue鏄紝false涓嶆槸 function IsPcOpen() { let userAgentInfo = navigator.userAgent; let Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPod', 'iPad', 'micromessenger']; let flag = true; for (let i = 0; i < Agents.length; i++) { if (userAgentInfo.indexOf(Agents[i]) > -1) { flag = false; break; } } if (window.screen.width >= 1100) { flag = true; } return flag; } //cookie.js var jsCookie = { addCookie: function (name, value, expireHours) {//娣诲姞鏂癱ookie var cookieString = name + "=" + escape(value); //鍒ゆ柇鏄惁璁剧疆杩囨湡鏃堕棿:0琛ㄧず涓嶈缃 if (expireHours > 0) { var date = new Date(); date.setTime(date.getTime() + expireHours * 3600 * 1000); cookieString = cookieString + "; expires=" + date.toGMTString(); } document.cookie = cookieString; }, getCookie: function (name) {//鏍规嵁cookie鍚嶇О寰楀埌鐩稿簲鐨刢ookie var strCookie = document.cookie; var arrCookie = strCookie.split("; "); for (var i = 0; i < arrCookie.length; i++) { var arr = arrCookie[i].split("="); if (arr[0] == name) return unescape(arr[1]); } return ""; }, deleteCookie: function (name) {//鍒犻櫎cookie var date = new Date(); date.setTime(date.getTime() - 10000); document.cookie = name + "=v; expires=" + date.toGMTString(); } }