/* * @description 杩欐槸鍔ㄦ€佽幏鍙栨祻瑙堝櫒鐨勫搴︼紝鐒跺悗璁剧疆rem * 浣跨敤鏂瑰紡锛氬搴?00px鍐?rem锛 瀹藉害520px鍐?.2rem */ function fnInitScreen() { var html = document.getElementsByTagName("html")[0]; var width = window.innerWidth; var font_size = 0; font_size = (width / 1920) * 100; //1500 璁捐鍥炬瘮渚 html.style.fontSize = font_size + "px"; } fnInitScreen(); /* * @description 鐩戝惉娴忚鍣ㄧ獥鍙g殑鍙樺姩 */ window.onresize = function () { fnInitScreen(); }; /* * @description 杩欐槸瀵艰埅鑿滃崟榧犳爣缁忚繃銆佺Щ鍑烘椂鍔ㄦ€佹坊鍔燾lass鐨勬柟娉 */ $(".navbar-block .nav-option-block").mouseover(function () { $(this).find("> a").addClass("navbar-checked-hover"); var _secondNavWidth = $(this).find('.navbar-second > div').width(); var _thisLeft = $(this).offset().left; $(this).find('.navbar-second > div').css('margin-left', _thisLeft - _secondNavWidth/2 + 78/2); console.log(_secondNavWidth, _thisLeft); }); $(".navbar-block .nav-option-block").mouseleave(function () { $(this).find("> a").removeClass("navbar-checked-hover"); }); /** * @description 鐐瑰嚮鎼滅储 灞曠ず 鎼滅储input */ $(".search-btn").on("click", function () { $(".search-btn").hide(); $(".search-input").show(); }); /** * @description 鐐瑰嚮鎼滅储 灞曠ず 鎼滅储input */ //$(".search-btn-submit").on("click", function () { // alert("鎵ц鎼滅储鏂规硶"); //}); /** * @description 鎵€鏈夎疆鎾浘鐨勫垏鎹㈤€熷害 */ $(".carousel").carousel({ interval: 3000, }); /** * @description 宸︿晶鑿滃崟 涓夌骇鑿滃崟灞曠ず鏁堟灉 */ $(".common-left-menu-list ul li").on("click", function (event) { event.stopPropagation(); $(this).find("> ul").toggle(); $(this).siblings().find("a").removeClass("common-left-minus"); if ($(this).find("> ul").css("display") == "none") { // $(this).find("> a").removeClass("common-left-minus"); // $(this).find("> a .menu-grey").show(); // $(this).find("> a .menu-blue").hide(); } else { // $(this).find("> a").addClass("common-left-minus"); // $(this).find("> a .menu-grey").hide(); // $(this).find("> a .menu-blue").show(); } // $(this).find("> a .glyphicon").toggleClass('glyphicon-minus'); $(this).find("> a span").toggle(); // $(this).find("> a img").toggle(); });