$(function() { // 注册栏默认值清空 $(".g_top input").focus(function() { if ($(this).val() == this.defaultValue) { $(this).val(""); }; }).blur(function() { if ($(this).val() == "") { $(this).val(this.defaultValue); }; }); }) var key = document.getElementById("key"); function searchInfo() { var base = $('head').data('base'); if (key.value) { location.href = base + "search.htmp?key=" + key.value; } else { alert('请输入您要搜索的关键词!'); } } key.addEventListener('keypress', function(event) { var keycode = event.keycode || event.which; if (keycode == "13") { searchInfo(); } }); function searchLink(el) { var href = $(el).attr("href"); location.href = href ? href : "/search.htmp?key=" + $(el).html(); } $(function() { $('.h_ser_icon').on('click', function() { $('.search_con').slideToggle(); $('.hser_icon1').toggle(); $('.hser_icon2').toggle(); }); }) function clickIE4(e) { var e = e || window.event; if (e.button && e.button == "2") { return false; } } function clickNS4(e) { var e = e || window.event; if (document.layers || document.getElementById && !document.all) { if (e.which == 2 || e.which == 3) { return false; } } } function OnDeny() { if (event.ctrlKey || event.keyCode == 78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode == 115) { return false; } } try { if (document.layers) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clickNS4; document.onkeydown = OnDeny(); } else if (document.all && !document.getElementById) { document.onmousedown = clickIE4; document.onkeydown = OnDeny(); } } catch (e) { } try { document.oncontextmenu = function () { return false; }; } catch (e) {} try { document.body.onselectstart = function () { return false; } } catch (e) {} try { document.body.oncopy = function () { return false; } } catch (e) {} $(document).ready(function () { $('.banner').slick({ autoplay: true, // 自动播放 autoplaySpeed: 4000, // 播放间隔 dots: true // 开启轮播图圆点 }); }); $(".fllst li").hover(function(){ $(this).addClass("cur"); },function(){ $(this).removeClass("cur"); }) $(".m_cptj").slide({ titCell: ".cptjhd li", mainCell: ".cptjbd", autoPlay: false, titOnClassName: "on", effect: "left", vis: 1,prevCell:".u_ljt",nextCell:".u_rjt" }); jQuery(".g_pro").slide({mainCell:".cplst ul",autoPlay:true,effect:"leftMarquee",vis:4,interTime:50,trigger:"click"}); jQuery(".g_pp").slide({ mainCell:".ppbd ul",vis:1,prevCell:".u_ljt",nextCell:".u_rjt",autoPlay:true,effect:"leftLoop"}); //数字增加动画 // $.fn.countTo = function(options) { // options = $.extend({}, $.fn.countTo.defaults, options || {}); // var loops = Math.ceil(options.speed / options.refreshInterval), // increment = (options.to - options.from) / loops; // return $(this).each(function() { // var _this = this, // loopCount = 0, // value = options.from, // interval = setInterval(updateTimer, options.refreshInterval); // function updateTimer() { // value += increment; // loopCount++; // $(_this).html(value.toFixed(options.decimals)); // if (typeof(options.onUpdate) == 'function') { // options.onUpdate.call(_this, value); // } // if (loopCount >= loops) { // clearInterval(interval); // value = options.to; // if (typeof(options.onComplete) == 'function') { // options.onComplete.call(_this, value); // } // } // } // }) // }; $(function(){ $('.ibanner').slide({mainCell:".bd",effect:"leftLoop",autoPlay:true,delayTime:500,interTime:5000}); $('.icustom-list').slide({mainCell:".bd",effect:"topLoop",vis:5}); function countadd(){ var count = 0; count++; $('.ibrand-num.ani li').each(function(){ dataperc = $(this).attr('data-perc'), $(this).find('.num').delay(6000).countTo({ from: 0, to: dataperc, speed: 2500, refreshInterval: 150 }); }); } function scrolltop(){ var top = $(window).scrollTop(); var htop = $('.ibrand-wrap').offset().top - $(window).height()/3; if(top>=htop){ countadd(); $('.ibrand-num').removeClass('ani'); } } scrolltop(); $(window).scroll(function(){ scrolltop(); }); }) jQuery(".m_pz").slide({ titCell: ".pzhd li", mainCell:".pzbd",vis:1,prevCell:".u_ljt",delayTime:1000, nextCell:".u_rjt",autoPlay:false,effect:"leftLoop"}); $(".m_an").slide({titOnClassName: "cur", titCell: ".anhd li", mainCell: ".anbd", effect: "left", autoPlay: false, startFun: function (i, c, s, titCell) { $(".ys2 em").eq(i).addClass("cur01").siblings("em").removeClass("cur01") $(".ys2 em").bind("mouseover", function () { $(".anhd li").eq($(this).index()).trigger("mouseover"); $(".ys2 em").eq($(this).index()).addClass("cur01").siblings("em").removeClass("cur01"); }); } }); $(".m_news").slide({ titCell: ".newhd li", mainCell: ".newbd", autoPlay: false, titOnClassName: "on", effect: "left",delayTime:00, vis: 1 }); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ new WOW().init(); }; $(function() { var time; //var winHeight = top.window.document.body.clientHeight || $(window.parent).height(); $('.client-2').css({ 'marginTop': -($('.client-2').height() / 2) }); $('#client-2 li').on({ 'mouseenter': function() { var scope = this; time = setTimeout(function() { var divDom = $(scope).children('div'); var maxWidth = divDom.width(); $(scope).stop().animate({ right: 77-maxWidth}, 'normal', function() { var pic = $(scope).find('.my-kefu-weixin-pic'); if (pic.length > 0) { pic.show(); } }); }, 100) }, 'mouseleave': function() { var pic = $(this).find('.my-kefu-weixin-pic'); var divDom = $(this).children('div'); var maxWidth = divDom.width(); if (pic.length > 0) { pic.hide(); } clearTimeout(time); var divDom = $(this).children('div'); $(this).stop().animate({ right: 0 }, "normal", function() {}); } }); //返回顶部 $(window).scroll(function() { var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; var eltop = $("#client-2").find(".my-kefu-ftop"); if (scrollTop > 0) { eltop.show(); } else { eltop.hide(); } }); $("#client-2").find(".my-kefu-ftop").click(function() { var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (scrollTop > 0) { $("html,body").animate({ scrollTop: 0 }, "slow"); } }); });