/*鍏叡js*/ /****************鑷�傚簲璁剧疆**************/ /*(function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function () { var clientWidth = docEl.clientWidth; if (!clientWidth) return; if(clientWidth>=750){ docEl.style.fontSize = '100px'; }else{ docEl.style.fontSize = 100 * (clientWidth / 750) + 'px'; } }; if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false); })(document, window);*/ $(document).ready(function() { $('.carton_button').on('click', function (e) { var media = document.getElementById("voMain"); var mi = $('.carton_button ').find("i"); if(mi.is(".fa-play")){ mi.removeClass("fa-play"); mi.addClass("fa-pause"); media.play(); //鎾斁 }else{ mi.removeClass("fa-pause"); mi.addClass("fa-play"); media.pause(); //鏆傚仠 } }); // 榧犳爣绉诲叆绉诲嚭浜嬩欢 $('.logo-s').hover(function() { // 榧犳爣绉诲叆鏃舵坊鍔爃over绫� $(this).attr("src", "jsp/main/images/logo1.png"); }, function() { // 榧犳爣绉诲嚭鏃剁Щ鍑篽over绫� $(this).attr("src", "jsp/main/images/logo180.png"); }); $('.head-search-a').on('click', function (e) { $(".h-search").slideToggle("slow"); if($(".h-search").css("display")=="none"){ $("#search-input").blur(); //澶卞幓鐒︾偣 }else{ $("#search-input").focus(); //璁剧疆鐒︾偣 } }); // 榧犳爣绉诲叆绉诲嚭浜嬩欢,绮鹃�夋渚� $('.case-item').hover(function() { // 榧犳爣绉诲叆鏃舵坊鍔爃over绫� $('.case-item').removeClass("active"); $(this).addClass("active"); }); /*瀛愬厓绱犱笉瑙﹀彂 鐢╩ouseenter 鍜宮ouseleave */ $(".h-pro-a").mouseenter(function() { setTimeout(function(){ $(".h-pro-a").children(".h-product").slideDown(200); },300); }); $(".h-pro-a").mouseleave(function() { if ($('.h-product').css('display') === 'none') { } else { $(".h-pro-a").children(".h-product").slideUp(200); } }); //鍥炶溅浜嬩欢锛屾悳绱骇鍝佸悕绉� $('#search-input').bind('keypress',function(event){ if(event.keyCode == "13") { let name = $('#search-input').val(); if(name !=""){ window.location.href = 'mainCt/toProduct?name='+encodeURI(encodeURI(name)); } } });//鏂规硶浜屽涓� /*$(document).keydown(function(e) { if (e.keyCode == 13) { //dologin(); } });*/ $(window).scroll(function(){ var scrollTop = $(this).scrollTop(); if(scrollTop > 300){ $(".article-img").slideUp(400); }else{ $(".article-img").slideDown(400); } }); //鍥炲埌椤堕儴 $(window).scroll(function() { if ($(window).scrollTop() > 500) { $('#uiGoTop').fadeIn(500); } else { $('#uiGoTop').fadeOut(500); } }); $('#uiGoTop').on('click', function() { $('body,html').animate({ scrollTop: 0 }, 600); }); }) function clearSearch() { $("#search-input").val(""); $("#search-input").focus(); } function toProduct(){ location.href = "mainCt/toProduct"; } function setProType(parentId){ $("#parentId").val(parentId); let typeId = $("#typeId").val(); location.href = "mainCt/toProduct?parentId="+parentId+"&typeId="+typeId; } function setTypeParentId(typeId){ $("#typeId").val(typeId); let parentId = $("#parentId").val(); location.href = "mainCt/toProduct?parentId="+parentId+"&typeId="+typeId; } function setProTypeAll(parentId){ $("#parentId").val(parentId); $("#typeId").val(""); location.href = "mainCt/toProduct?parentId="+parentId; } function setTypeId(id){ $("#typeId").val(id); var typeId = $("#typeId").val(); location.href = "mainCt/toInfomation?typeId="+typeId; }