$(function () { layui.use(function() { let form = layui.form; let layer = layui.layer; let that = null, datacid = null; //wow if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ new WOW().init(); } //nav $(".nav ul li").hover(function () { that = $(this), dcid = $(this).attr("data-cid"); that.addClass("on").siblings("li").removeClass("on"); },function () { $(".nav ul li").each(function(i, v) { datacid = $(this).attr("data-cid"); if(datacid == CATID && datacid != undefined || BCID == datacid){ $(this).addClass("on"); return false; } }); if(dcid != BCID){ $(this).removeClass("on"); } }); //langs form.on('select(select-langs)', function(data){ var value = data.value; window.location.href = value; //layer.confirm('是否跳转到['+this.innerHTML+']站点', {title: false}, function(){ // window.location.href = value; //}); }); //search $(".click-search").on("click",function () { var keywords = $.trim($(".keywords").val()); if (keywords=='') {return false;} }); //top $("#get_top").on("click",function () { $("body,html").animate({ scrollTop : 0 }, 1000); }); $(".go-bottom").on("click",function () { $("body,html").animate({ scrollTop: $('.plate').offset().top },700) }); //table TableCou(); //style $(".box-content .right-top-con,.box-content").css('min-height',$(window).height() - 135 - $(".footer").outerHeight()); $(".detail iframe,.detail table").css("width","100%"); }); //禁止右键 if (ONCONTEXT) { document.oncontextmenu = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } } } //屏蔽复制 if (ONCOPY) { document.oncopy = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } } } //屏蔽选中 if (ONSELECT) { document.onselectstart = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e) { return false; } } } }); //TableCou function TableCou(){ var table = $("table"); var maxTdCount = 0; //td最大列数 var colgroup = ''; $('table tbody tr').each(function() { var tdCount = $(this).find('td').length; if (tdCount > maxTdCount) { maxTdCount = tdCount; } }); //colgroup table.find("colgroup").remove(); colgroup += ``; table.prepend(colgroup); }