bindEvent(); function bindEvent() { // 娴姩渚ф爮瀹氶珮搴 var fixedLeftBar = $('.fixed_left_bar').get(0); if(fixedLeftBar) { var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; var minHeight = winHeight - 110; fixedLeftBar.style.height = minHeight + 'px'; } } $(function(){ var $bottomTools = $('.bottom_tools'); var scrollIcon = $("#scrollUp"); var t = 0; $(window).scroll(function () { var scrollHeight = $(document).height(); var scrollTop = $(window).scrollTop(); var $windowHeight = $(window).innerHeight(); if (scrollTop > $windowHeight) { scrollIcon.fadeIn(200).css("display","block"); clearTimeout(t); t = setTimeout(function(){scrollIcon.fadeOut(600)},4000); } else { scrollIcon.fadeOut(200); } $bottomTools.css("bottom", scrollHeight - scrollTop > $windowHeight ? 40 : $windowHeight + scrollTop + 40 - scrollHeight); }); $('#scrollUp').click(function (e) { e.preventDefault(); $('html,body').animate({ scrollTop:0}, 500); }); }); //// 鍒ゆ柇甯﹀乏渚ф爮鐨勯〉闈㈢被鍒 //var caseType = parseInt(getQueryVariable('type')); //var leftBtns = $('.left_btns a'); //if(caseType) { // $('.left_btns a').eq(caseType - 1).addClass('active'); //} else { // $('.left_btns a').eq(0).addClass('active'); //} var IEVersion = getIEVersion(); if(IEVersion && IEVersion < 9) { $('.label_btns a:last-child').css({'margin-right': '0'}); } // 鑾峰彇IE鐗堟湰 function getIEVersion() { var userAgent = navigator.userAgent; //鍙栧緱娴忚鍣ㄧ殑userAgent瀛楃涓 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //鍒ゆ柇鏄惁IE娴忚鍣 if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return 7; } else if (fIEVersion == 8) { return 8; } else if (fIEVersion == 9) { return 9; } else if (fIEVersion == 10) { return 10; } else if (fIEVersion == 11) { return 11; } else { return 0 }//IE鐗堟湰杩囦綆 } } // 鑾峰彇url鍙傛暟鏂规硶 function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i