//判断页面内容全部加载完成 加载动画 var width_ = $(window).width(); var height_ = $(window).height(); var motiontime = 1700; if(width_<768){ motiontime = 1000 } //document.onreadystatechange = function () {//即在加载的过程中执行下面的代码 // if(document.readystate == "complete"){//complete加载完成 // $(".loading").fadeout(); // settimeout(function(){ // },motiontime); // $(".wrapper").addclass("restart") // } //} // //settimeout(function(){ // if($(".loading").attr("style").indexof("display: none;")){ // $(".loading").fadeout(); // settimeout(function(){ // },motiontime); // $(".wrapper").addclass("restart") // } //},2000); $(function(){ $('.conrp #owl-demo').owlcarousel({ addclassactive:true, items: 1, autoplay: true, touchdrag:true, autoplayhoverpause:true, responsiveclass:true, stoponhover:true, navigation: true, navigationtext: ["",""], }); }); $('.scroll_img').click(function(){ $('body,html').animate({scrolltop:$('.abouts').offset().top},600); }); /*! waypoints - 4.0.0 copyright 漏 2011-2015 caleb troughton licensed under the mit license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ $(function(){ $('.counter').countup(); }); !function(){"use strict";function t(o){if(!o)throw new error("no options passed to waypoint constructor");if(!o.element)throw new error("no element option passed to waypoint constructor");if(!o.handler)throw new error("no handler option passed to waypoint constructor");this.key="waypoint-"+e,this.options=t.adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerpoint=null,this.group=t.group.findorcreate({name:this.options.group,axis:this.axis}),this.context=t.context.findorcreatebyelement(this.options.context),t.offsetaliases[this.options.offset]&&(this.options.offset=t.offsetaliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queuetrigger=function(t){this.group.queuetrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeall=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyall=function(){t.invokeall("destroy")},t.disableall=function(){t.invokeall("disable")},t.enableall=function(){t.invokeall("enable")},t.refreshall=function(){t.context.refreshall()},t.viewportheight=function(){return window.innerheight||document.documentelement.clientheight},t.viewportwidth=function(){return document.documentelement.clientwidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetaliases={"bottom-in-view":function(){return this.context.innerheight()-this.adapter.outerheight()},"right-in-view":function(){return this.context.innerwidth()-this.adapter.outerwidth()}},window.waypoint=t}(),function(){"use strict";function t(t){window.settimeout(t,1e3/60)}function e(t){this.element=t,this.adapter=n.adapter,this.adapter=new this.adapter(t),this.key="waypoint-context-"+i,this.didscroll=!1,this.didresize=!1,this.oldscroll={x:this.adapter.scrollleft(),y:this.adapter.scrolltop()},this.waypoints={vertical:{},horizontal:{}},t.waypointcontextkey=this.key,o[t.waypointcontextkey]=this,i+=1,this.createthrottledscrollhandler(),this.createthrottledresizehandler()}var i=0,o={},n=window.waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkempty=function(){var t=this.adapter.isemptyobject(this.waypoints.horizontal),e=this.adapter.isemptyobject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createthrottledresizehandler=function(){function t(){e.handleresize(),e.didresize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didresize||(e.didresize=!0,n.requestanimationframe(t))})},e.prototype.createthrottledscrollhandler=function(){function t(){e.handlescroll(),e.didscroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didscroll||n.istouch)&&(e.didscroll=!0,n.requestanimationframe(t))})},e.prototype.handleresize=function(){n.context.refreshall()},e.prototype.handlescroll=function(){var t={},e={horizontal:{newscroll:this.adapter.scrollleft(),oldscroll:this.oldscroll.x,forward:"right",backward:"left"},vertical:{newscroll:this.adapter.scrolltop(),oldscroll:this.oldscroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newscroll>o.oldscroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldscroll=a.triggerpoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queuetrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushtriggers();this.oldscroll={x:e.horizontal.newscroll,y:e.vertical.newscroll}},e.prototype.innerheight=function(){return this.element==this.element.window?n.viewportheight():this.adapter.innerheight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkempty()},e.prototype.innerwidth=function(){return this.element==this.element.window?n.viewportwidth():this.adapter.innerwidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handlescroll(),t={horizontal:{contextoffset:e?0:i.left,contextscroll:e?0:this.oldscroll.x,contextdimension:this.innerwidth(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:e?0:i.top,contextscroll:e?0:this.oldscroll.y,contextdimension:this.innerheight(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerpoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetprop]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parsefloat(f),d.options.offset.indexof("%")>-1&&(f=math.ceil(s.contextdimension*f/100))),l=s.contextscroll-s.contextoffset,d.triggerpoint=y+l-f,h=w=s.oldscroll,u=h&&p,c=!h&&!p,!g&&u?(d.queuetrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queuetrigger(s.forward),o[d.group.id]=d.group):g&&s.oldscroll>=d.triggerpoint&&(d.queuetrigger(s.forward),o[d.group.id]=d.group)}}return n.requestanimationframe(function(){for(var t in o)o[t].flushtriggers()}),this},e.findorcreatebyelement=function(t){return e.findbyelement(t)||new e(t)},e.refreshall=function(){for(var t in o)o[t].refresh()},e.findbyelement=function(t){return o[t.waypointcontextkey]},window.onload=function(){r&&r(),e.refreshall()},n.requestanimationframe=function(e){var i=window.requestanimationframe||window.mozrequestanimationframe||window.webkitrequestanimationframe||t;i.call(window,e)},n.context=e}(),function(){"use strict";function t(t,e){return t.triggerpoint-e.triggerpoint}function e(t,e){return e.triggerpoint-t.triggerpoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.cleartriggerqueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.cleartriggerqueues=function(){this.triggerqueues={up:[],down:[],left:[],right:[]}},i.prototype.flushtriggers=function(){for(var i in this.triggerqueues){var o=this.triggerqueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.cleartriggerqueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.adapter.inarray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.adapter.inarray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queuetrigger=function(t,e){this.triggerqueues[e].push(t)},i.prototype.remove=function(t){var e=n.adapter.inarray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findorcreate=function(t){return o[t.axis][t.name]||new i(t)},n.group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jquery,i=window.waypoint;e.each(["innerheight","innerwidth","off","offset","on","outerheight","outerwidth","scrollleft","scrolltop"],function(e,i){t.prototype[i]=function(){var t=array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inarray","isemptyobject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",adapter:t}),i.adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isfunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.waypoint;window.jquery&&(window.jquery.fn.waypoint=t(window.jquery)),window.zepto&&(window.zepto.fn.waypoint=t(window.zepto))}();!function(t){"use strict";t.fn.countup=function(e){var a=t.extend({time:2e2,delay:1},e);return this.each(function(){var e=t(this),n=a,u=function(){e.data("counterupto")||e.data("counterupto",e.text());var t=parseint(e.data("counter-time"))>0?parseint(e.data("counter-time")):n.time,a=parseint(e.data("counter-delay"))>0?parseint(e.data("counter-delay")):n.delay,u=t/a,r=e.data("counterupto"),o=[r],c=/[0-9]+,[0-9]+/.test(r);r=r.replace(/,/g,"");for(var d=(/^[0-9]+$/.test(r),/^[0-9]+\.[0-9]+$/.test(r)),s=d?(r.split(".")[1]||[]).length:0,i=u;i>=1;i--){var p=parseint(math.round(r/u*i));if(d&&(p=parsefloat(r/u*i).tofixed(s)),c)for(;/(\d+)(\d{3})/.test(p.tostring());)p=p.tostring().replace(/(\d+)(\d{3})/,"$1,$2");o.unshift(p)}e.data("counterup-nums",o),e.text("0");var f=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?settimeout(e.data("counterup-func"),a):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",f),settimeout(e.data("counterup-func"),a)};e.waypoint(u,{offset:"100%",triggeronce:!0})})}}(jquery); //产品展示 $(function(){ $('.cpzs_bo #owl-demo').owlcarousel({ items: 3, autoplay: true, navigation: true, navigationtext: ["",""], itemsdesktop:[1199,2], itemstablet:[768,2], }); }); //新闻资讯 $(function(){ $('.news_img #owl-demo').owlcarousel({ addclassactive:true, items: 1, autoplay: true, touchdrag:true, autoplayhoverpause:true, responsiveclass:true, stoponhover:true, navigation: true, navigationtext: ["",""], }); }); //公共脚本文件js漂浮广告代码(简洁!)start float.js function closemove() { document.getelementbyid("gg1").style.display = "none"; } function addevent(obj, evttype, func, cap) { cap = cap || false; if (obj.addeventlistener) { obj.addeventlistener(evttype, func, cap); return true; } else if (obj.attachevent) { if (cap) { obj.setcapture(); return true; } else { return obj.attachevent("on" + evttype, func); } } else { return false; } } function getpagescroll() { var xscroll, yscroll; if (self.pagexoffset) { xscroll = self.pagexoffset; } else if (document.documentelement && document.documentelement.scrollleft) { xscroll = document.documentelement.scrollleft; } else if (document.body) { xscroll = document.body.scrollleft; } if (self.pageyoffset) { yscroll = self.pageyoffset; } else if (document.documentelement && document.documentelement.scrolltop) { yscroll = document.documentelement.scrolltop; } else if (document.body) { yscroll = document.body.scrolltop; } arraypagescroll = new array(xscroll, yscroll); return arraypagescroll; } function getpagesize() { var xscroll, yscroll; if (window.innerheight && window.scrollmaxy) { xscroll = document.body.scrollwidth; yscroll = window.innerheight + window.scrollmaxy; } else if (document.body.scrollheight > document.body.offsetheight) { xscroll = document.body.scrollwidth; yscroll = document.body.scrollheight; } else { xscroll = document.body.offsetwidth; yscroll = document.body.offsetheight; } var windowwidth, windowheight; if (self.innerheight) { windowwidth = self.innerwidth; windowheight = self.innerheight; } else if (document.documentelement && document.documentelement.clientheight) { windowwidth = document.documentelement.clientwidth; windowheight = document.documentelement.clientheight; } else if (document.body) { windowwidth = document.body.clientwidth; windowheight = document.body.clientheight; } if (yscroll < windowheight) { pageheight = windowheight; } else { pageheight = yscroll; } if (xscroll < windowwidth) { pagewidth = windowwidth; } else { pagewidth = xscroll; } arraypagesize = new array(pagewidth, pageheight, windowwidth, windowheight) return arraypagesize; } //广告脚本文件 js漂浮广告代码(简洁!) admove.js /* 例子
***** content ******
var ad=new admove("div2"); ad.run(); */ //////////////////////////////////////////////////////// var admoveconfig = new object(); admoveconfig.isinitialized = false; admoveconfig.scrollx = 0; admoveconfig.scrolly = 0; admoveconfig.movewidth = 0; admoveconfig.moveheight = 0; admoveconfig.resize = function () { var winsize = getpagesize(); admoveconfig.movewidth = winsize[2]; admoveconfig.moveheight = winsize[3]; admoveconfig.scroll(); } admoveconfig.scroll = function () { var winscroll = getpagescroll(); admoveconfig.scrollx = winscroll[0]; admoveconfig.scrolly = winscroll[1]; } addevent(window, "resize", admoveconfig.resize); addevent(window, "scroll", admoveconfig.scroll); function admove(id) { if (!admoveconfig.isinitialized) { admoveconfig.resize(); admoveconfig.isinitialized = true; } var obj = document.getelementbyid(id); obj.style.position = "absolute"; var w = admoveconfig.movewidth - obj.offsetwidth; var h = admoveconfig.moveheight - obj.offsetheight; var x = w * math.random(), y = h * math.random(); var rad = (math.random() + 1) * math.pi / 6; var kx = math.sin(rad), ky = math.cos(rad); var dirx = (math.random() < 0.5 ? 1 : -1), diry = (math.random() < 0.5 ? 1 : -1); var step = 1; var interval; this.setlocation = function (vx, vy) { x = vx; y = vy; } this.setdirection = function (vx, vy) { dirx = vx; diry = vy; } obj.custommethod = function () { obj.style.left = (x + admoveconfig.scrollx) + "px"; obj.style.top = (y + admoveconfig.scrolly) + "px"; rad = (math.random() + 1) * math.pi / 6; w = admoveconfig.movewidth - obj.offsetwidth; h = admoveconfig.moveheight - obj.offsetheight; x = x + step * kx * dirx; if (x < 0) { dirx = 1; x = 0; kx = math.sin(rad); ky = math.cos(rad); } if (x > w) { dirx = -1; x = w; kx = math.sin(rad); ky = math.cos(rad); } y = y + step * ky * diry; if (y < 0) { diry = 1; y = 0; kx = math.sin(rad); ky = math.cos(rad); } if (y > h) { diry = -1; y = h; kx = math.sin(rad); ky = math.cos(rad); } } this.run = function () { var delay = 10; interval = setinterval(obj.custommethod, delay); obj.onmouseover = function () { clearinterval(interval); } obj.onmouseout = function () { interval = setinterval(obj.custommethod, delay); } } } jquery(".txtmarquee-left").slide({maincell:".bd ul",autoplay:true,effect:"leftmarquee",vis:2,intertime:30}); jquery(".picscroll-left").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"left",autoplay:true}); jquery(".sidemen").slide({titcell:"h3", targetcell:"ul",defaultindex:1,effect:"slidedown",delaytime:300,returndefault:true}); jquery(".sidemenu").slide({titcell:"h3", targetcell:"ul", effect:"slidedown", delaytime:300 , triggertime:150, defaultplay:true, returndefault:true}); jquery(".picscroll-lefta").slide({titcell:".hda ul",maincell:".bda ul",autopage:true,effect:"left",autoplay:true,trigger:"click"}); jquery(".picscroll-leftb").slide({titcell:".hdb ul",maincell:".bdb ul",autopage:true,effect:"left",autoplay:true}); /*! waypoints - 4.0.0 copyright 漏 2011-2015 caleb troughton licensed under the mit license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ $(function(){ $('.counter').countup(); }); !function(){"use strict";function t(o){if(!o)throw new error("no options passed to waypoint constructor");if(!o.element)throw new error("no element option passed to waypoint constructor");if(!o.handler)throw new error("no handler option passed to waypoint constructor");this.key="waypoint-"+e,this.options=t.adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerpoint=null,this.group=t.group.findorcreate({name:this.options.group,axis:this.axis}),this.context=t.context.findorcreatebyelement(this.options.context),t.offsetaliases[this.options.offset]&&(this.options.offset=t.offsetaliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queuetrigger=function(t){this.group.queuetrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeall=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyall=function(){t.invokeall("destroy")},t.disableall=function(){t.invokeall("disable")},t.enableall=function(){t.invokeall("enable")},t.refreshall=function(){t.context.refreshall()},t.viewportheight=function(){return window.innerheight||document.documentelement.clientheight},t.viewportwidth=function(){return document.documentelement.clientwidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetaliases={"bottom-in-view":function(){return this.context.innerheight()-this.adapter.outerheight()},"right-in-view":function(){return this.context.innerwidth()-this.adapter.outerwidth()}},window.waypoint=t}(),function(){"use strict";function t(t){window.settimeout(t,1e3/60)}function e(t){this.element=t,this.adapter=n.adapter,this.adapter=new this.adapter(t),this.key="waypoint-context-"+i,this.didscroll=!1,this.didresize=!1,this.oldscroll={x:this.adapter.scrollleft(),y:this.adapter.scrolltop()},this.waypoints={vertical:{},horizontal:{}},t.waypointcontextkey=this.key,o[t.waypointcontextkey]=this,i+=1,this.createthrottledscrollhandler(),this.createthrottledresizehandler()}var i=0,o={},n=window.waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkempty=function(){var t=this.adapter.isemptyobject(this.waypoints.horizontal),e=this.adapter.isemptyobject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createthrottledresizehandler=function(){function t(){e.handleresize(),e.didresize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didresize||(e.didresize=!0,n.requestanimationframe(t))})},e.prototype.createthrottledscrollhandler=function(){function t(){e.handlescroll(),e.didscroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didscroll||n.istouch)&&(e.didscroll=!0,n.requestanimationframe(t))})},e.prototype.handleresize=function(){n.context.refreshall()},e.prototype.handlescroll=function(){var t={},e={horizontal:{newscroll:this.adapter.scrollleft(),oldscroll:this.oldscroll.x,forward:"right",backward:"left"},vertical:{newscroll:this.adapter.scrolltop(),oldscroll:this.oldscroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newscroll>o.oldscroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldscroll=a.triggerpoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queuetrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushtriggers();this.oldscroll={x:e.horizontal.newscroll,y:e.vertical.newscroll}},e.prototype.innerheight=function(){return this.element==this.element.window?n.viewportheight():this.adapter.innerheight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkempty()},e.prototype.innerwidth=function(){return this.element==this.element.window?n.viewportwidth():this.adapter.innerwidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handlescroll(),t={horizontal:{contextoffset:e?0:i.left,contextscroll:e?0:this.oldscroll.x,contextdimension:this.innerwidth(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:e?0:i.top,contextscroll:e?0:this.oldscroll.y,contextdimension:this.innerheight(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerpoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetprop]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parsefloat(f),d.options.offset.indexof("%")>-1&&(f=math.ceil(s.contextdimension*f/100))),l=s.contextscroll-s.contextoffset,d.triggerpoint=y+l-f,h=w=s.oldscroll,u=h&&p,c=!h&&!p,!g&&u?(d.queuetrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queuetrigger(s.forward),o[d.group.id]=d.group):g&&s.oldscroll>=d.triggerpoint&&(d.queuetrigger(s.forward),o[d.group.id]=d.group)}}return n.requestanimationframe(function(){for(var t in o)o[t].flushtriggers()}),this},e.findorcreatebyelement=function(t){return e.findbyelement(t)||new e(t)},e.refreshall=function(){for(var t in o)o[t].refresh()},e.findbyelement=function(t){return o[t.waypointcontextkey]},window.onload=function(){r&&r(),e.refreshall()},n.requestanimationframe=function(e){var i=window.requestanimationframe||window.mozrequestanimationframe||window.webkitrequestanimationframe||t;i.call(window,e)},n.context=e}(),function(){"use strict";function t(t,e){return t.triggerpoint-e.triggerpoint}function e(t,e){return e.triggerpoint-t.triggerpoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.cleartriggerqueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.cleartriggerqueues=function(){this.triggerqueues={up:[],down:[],left:[],right:[]}},i.prototype.flushtriggers=function(){for(var i in this.triggerqueues){var o=this.triggerqueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.cleartriggerqueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.adapter.inarray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.adapter.inarray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queuetrigger=function(t,e){this.triggerqueues[e].push(t)},i.prototype.remove=function(t){var e=n.adapter.inarray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findorcreate=function(t){return o[t.axis][t.name]||new i(t)},n.group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jquery,i=window.waypoint;e.each(["innerheight","innerwidth","off","offset","on","outerheight","outerwidth","scrollleft","scrolltop"],function(e,i){t.prototype[i]=function(){var t=array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inarray","isemptyobject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",adapter:t}),i.adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isfunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.waypoint;window.jquery&&(window.jquery.fn.waypoint=t(window.jquery)),window.zepto&&(window.zepto.fn.waypoint=t(window.zepto))}();!function(t){"use strict";t.fn.countup=function(e){var a=t.extend({time:2e2,delay:1},e);return this.each(function(){var e=t(this),n=a,u=function(){e.data("counterupto")||e.data("counterupto",e.text());var t=parseint(e.data("counter-time"))>0?parseint(e.data("counter-time")):n.time,a=parseint(e.data("counter-delay"))>0?parseint(e.data("counter-delay")):n.delay,u=t/a,r=e.data("counterupto"),o=[r],c=/[0-9]+,[0-9]+/.test(r);r=r.replace(/,/g,"");for(var d=(/^[0-9]+$/.test(r),/^[0-9]+\.[0-9]+$/.test(r)),s=d?(r.split(".")[1]||[]).length:0,i=u;i>=1;i--){var p=parseint(math.round(r/u*i));if(d&&(p=parsefloat(r/u*i).tofixed(s)),c)for(;/(\d+)(\d{3})/.test(p.tostring());)p=p.tostring().replace(/(\d+)(\d{3})/,"$1,$2");o.unshift(p)}e.data("counterup-nums",o),e.text("0");var f=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?settimeout(e.data("counterup-func"),a):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",f),settimeout(e.data("counterup-func"),a)};e.waypoint(u,{offset:"100%",triggeronce:!0})})}}(jquery); function closemove() { document.getelementbyid("gg1").style.display = "none"; } function addevent(obj, evttype, func, cap) { cap = cap || false; if (obj.addeventlistener) { obj.addeventlistener(evttype, func, cap); return true; } else if (obj.attachevent) { if (cap) { obj.setcapture(); return true; } else { return obj.attachevent("on" + evttype, func); } } else { return false; } } function getpagescroll() { var xscroll, yscroll; if (self.pagexoffset) { xscroll = self.pagexoffset; } else if (document.documentelement && document.documentelement.scrollleft) { xscroll = document.documentelement.scrollleft; } else if (document.body) { xscroll = document.body.scrollleft; } if (self.pageyoffset) { yscroll = self.pageyoffset; } else if (document.documentelement && document.documentelement.scrolltop) { yscroll = document.documentelement.scrolltop; } else if (document.body) { yscroll = document.body.scrolltop; } arraypagescroll = new array(xscroll, yscroll); return arraypagescroll; } function getpagesize() { var xscroll, yscroll; if (window.innerheight && window.scrollmaxy) { xscroll = document.body.scrollwidth; yscroll = window.innerheight + window.scrollmaxy; } else if (document.body.scrollheight > document.body.offsetheight) { xscroll = document.body.scrollwidth; yscroll = document.body.scrollheight; } else { xscroll = document.body.offsetwidth; yscroll = document.body.offsetheight; } var windowwidth, windowheight; if (self.innerheight) { windowwidth = self.innerwidth; windowheight = self.innerheight; } else if (document.documentelement && document.documentelement.clientheight) { windowwidth = document.documentelement.clientwidth; windowheight = document.documentelement.clientheight; } else if (document.body) { windowwidth = document.body.clientwidth; windowheight = document.body.clientheight; } if (yscroll < windowheight) { pageheight = windowheight; } else { pageheight = yscroll; } if (xscroll < windowwidth) { pagewidth = windowwidth; } else { pagewidth = xscroll; } arraypagesize = new array(pagewidth, pageheight, windowwidth, windowheight) return arraypagesize; } //广告脚本文件 js漂浮广告代码(简洁!) admove.js /* 例子
***** content ******
var ad=new admove("div2"); ad.run(); */ //////////////////////////////////////////////////////// var admoveconfig = new object(); admoveconfig.isinitialized = false; admoveconfig.scrollx = 0; admoveconfig.scrolly = 0; admoveconfig.movewidth = 0; admoveconfig.moveheight = 0; admoveconfig.resize = function () { var winsize = getpagesize(); admoveconfig.movewidth = winsize[2]; admoveconfig.moveheight = winsize[3]; admoveconfig.scroll(); } admoveconfig.scroll = function () { var winscroll = getpagescroll(); admoveconfig.scrollx = winscroll[0]; admoveconfig.scrolly = winscroll[1]; } addevent(window, "resize", admoveconfig.resize); addevent(window, "scroll", admoveconfig.scroll); function admove(id) { if (!admoveconfig.isinitialized) { admoveconfig.resize(); admoveconfig.isinitialized = true; } var obj = document.getelementbyid(id); obj.style.position = "absolute"; var w = admoveconfig.movewidth - obj.offsetwidth; var h = admoveconfig.moveheight - obj.offsetheight; var x = w * math.random(), y = h * math.random(); var rad = (math.random() + 1) * math.pi / 6; var kx = math.sin(rad), ky = math.cos(rad); var dirx = (math.random() < 0.5 ? 1 : -1), diry = (math.random() < 0.5 ? 1 : -1); var step = 1; var interval; this.setlocation = function (vx, vy) { x = vx; y = vy; } this.setdirection = function (vx, vy) { dirx = vx; diry = vy; } obj.custommethod = function () { obj.style.left = (x + admoveconfig.scrollx) + "px"; obj.style.top = (y + admoveconfig.scrolly) + "px"; rad = (math.random() + 1) * math.pi / 6; w = admoveconfig.movewidth - obj.offsetwidth; h = admoveconfig.moveheight - obj.offsetheight; x = x + step * kx * dirx; if (x < 0) { dirx = 1; x = 0; kx = math.sin(rad); ky = math.cos(rad); } if (x > w) { dirx = -1; x = w; kx = math.sin(rad); ky = math.cos(rad); } y = y + step * ky * diry; if (y < 0) { diry = 1; y = 0; kx = math.sin(rad); ky = math.cos(rad); } if (y > h) { diry = -1; y = h; kx = math.sin(rad); ky = math.cos(rad); } } this.run = function () { var delay = 10; interval = setinterval(obj.custommethod, delay); obj.onmouseover = function () { clearinterval(interval); } obj.onmouseout = function () { interval = setinterval(obj.custommethod, delay); } } }