$(window).load(function(){ $(".he_zdiv .fl").click(function () { $(this).addClass("active").siblings().removeClass("active"); }); $(".he").click(function () { $('.he_danw').show(); $('.youq_lj').hide(); }); $(".yq").click(function () { $('.he_danw').hide(); $('.youq_lj').show(); }); // 三级导航 $(".j_sxc").hover(function () { $(this).find(".cemg_flex").css({"background-color":"#fff"}); $(this).find(".cemg_flex a").css({"color":"#000"}); $(this).find(".po_baisc").show(); },function () { $(this).find(".cemg_flex").css({"background-color":"rgba(61,62,64,.7)"}); $(this).find(".cemg_flex a").css({"color":"#fff"}); $(this).find(".po_baisc").hide(); }); // 交易市场 鼠标移入 $(".gaj_x").mouseenter(function () { $(this).find(".lan_bg").stop().animate({opacity:"1"}) }); $(".gaj_x").mouseleave(function () { $(this).find(".lan_bg").stop().animate({opacity:"0"}) }); //会员中心左侧菜单 $(document).on('click','.left-menu .block',function(){ // $(".left-menu .block").click(function(){ if($(this).find(".updown").hasClass("jian")){ $(this).siblings("ul").slideUp(); $(this).find(".updown").removeClass("jian"); }else{ $(this).siblings("ul").slideDown(); $(this).find(".updown").addClass("jian"); } }); var hegirt=$(".right_main").height(); $(".bgo_bs").css({height:hegirt-110}) }) // 获取地址栏中的参数 // 如getParam("key") function getParam(paramName) { paramValue = ""; isFound = false; if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"); i = 0; while (i < arrSource.length && !isFound) { if (arrSource[i].indexOf("=") > 0) { if (arrSource[i].split("=")[0].toLowerCase() == paramName .toLowerCase()) { paramValue = arrSource[i].split("=")[1]; isFound = true; } } i++; } } return paramValue; } //获取cookie function getCookie(name) { var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)) return decodeURIComponent(arr[2]); else return null; } //删除cookie function delCookie(name) { var date=new Date(); date.setTime(date.getTime()-10000); var delValue = getCookie(name); if (delValue) { document.cookie = name+'='+delValue+';expires='+date.toGMTString()+"; path=/"; } } // 重写方法,自定义格式化日期 Date.prototype.toLocaleString = function() { // 补0 例如 2018/7/10 14:7:2 补完后为 2018/07/10 14:07:02 function addZero(num){ if(num<10) return "0" + num; return num; } // 按自定义拼接格式返回 return this.getFullYear() + "-" + addZero(this.getMonth() + 1) + "-" + addZero(this.getDate())+" "+ + addZero(this.getHours()) + ":" + addZero(this.getMinutes()) + ":" + addZero(this.getSeconds()); };