$(".fullSlide").hover(function () { $(this).find("p").fadeToggle(); }); jQuery(".fullSlide").slide({ mainCell: ".bd .con", delayTime: 300, interTime: 3000, effect: "fade", titCell: ".hd li", autoPlay: true, titOnClassName: "on" }); //绐楀彛鏄剧ず鎵嶅姞杞 var wrapTop = $(".gun").offset().top; var istrue = true; $(window).on("scroll", function () { var s = $(window).scrollTop(); if (s > wrapTop - 500 && istrue) { $(".timer").each(count); function count(a) { var b = $(this); a = $.extend({}, a || {}, b.data("countToOptions") || {}); b.countTo(a) }; istrue = false; }; }) //璁剧疆璁℃暟 $.fn.countTo = function (options) { options = options || {}; return $(this).each(function () { //褰撳墠鍏冪礌鐨勯€夐」 var settings = $.extend({}, $.fn.countTo.defaults, { from: $(this).data('from'), to: $(this).data('to'), speed: $(this).data('speed'), refreshInterval: $(this).data('refresh-interval'), decimals: $(this).data('decimals') }, options); //鏇存柊鍊 var loops = Math.ceil(settings.speed / settings.refreshInterval), increment = (settings.to - settings.from) / loops; //鏇存敼搴旂敤鍜屽彉閲 var self = this, $self = $(this), loopCount = 0, value = settings.from, data = $self.data('countTo') || {}; $self.data('countTo', data); //濡傛灉鏈夐棿鏂紝鎵惧埌骞舵竻闄 if (data.interval) { clearInterval(data.interval); }; data.interval = setInterval(updateTimer, settings.refreshInterval); //鍒濆鍖栬捣濮嬪€ render(value); function updateTimer() { value += increment; loopCount++; render(value); if (typeof (settings.onUpdate) == 'function') { settings.onUpdate.call(self, value); } if (loopCount >= loops) { //绉诲嚭闂撮殧 $self.removeData('countTo'); clearInterval(data.interval); value = settings.to; if (typeof (settings.onComplete) == 'function') { settings.onComplete.call(self, value); } } } function render(value) { var formattedValue = settings.formatter.call(self, value, settings); $self.html(formattedValue); } }); }; $.fn.countTo.defaults = { from: 0, //鏁板瓧寮€濮嬬殑鍊 to: 0, //鏁板瓧缁撴潫鐨勫€ speed: 1000, //璁剧疆姝ラ暱鐨勬椂闂 refreshInterval: 100, //闅旈棿鍊 decimals: 0, //鏄剧ず灏忎綅鏁 formatter: formatter, //娓叉煋涔嬪墠鏍煎紡鍖 onUpdate: null, //姣忔鏇存柊鍓嶇殑鍥炶皟鏂规硶 onComplete: null //瀹屾垚鏇存柊鐨勫洖璋冩柟娉 }; function formatter(value, settings) { return value.toFixed(settings.decimals); } //鑷畾涔夋牸寮 $('#count-number').data('countToOptions', { formmatter: function (value, options) { return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); } }); //瀹氭椂鍣 $('.timer').each(count); function count(options) { var $this = $(this); options = $.extend({}, options || {}, $this.data('countToOptions') || {}); $this.countTo(options); } $(document).ready(function () { jQuery(".yous").slide({ titCell: ".ys_li ul li", mainCell: ".sq_box", trigger: "mouseover", titOnClassName: "on", prevCell: ".sprev", nextCell: ".snext", effect: "fade" }); }); 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) }); //杩斿洖椤堕儴 $(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"); } }); });