Foros del Web » Programando para Internet » Jquery »

Efecto cargando.....

Estas en el tema de Efecto cargando..... en el foro de Jquery en Foros del Web. Buenos días, por favor me podría decir alguien si puedo hacer un efecto de loading.... pero viendo el tanto por ciento que queda por cargar ...
  #1 (permalink)  
Antiguo 26/10/2015, 02:09
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 3 meses
Puntos: 10
Efecto cargando.....

Buenos días, por favor me podría decir alguien si puedo hacer un efecto de loading.... pero viendo el tanto por ciento que queda por cargar la página en lugar de una imagen. Gracias y un saludo
  #2 (permalink)  
Antiguo 26/10/2015, 06:28
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 11 años, 5 meses
Puntos: 401
Respuesta: Efecto cargando.....

Tienes muchísimos.... por ejemplo este.
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #3 (permalink)  
Antiguo 26/10/2015, 18:18
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 3 meses
Puntos: 10
Respuesta: Efecto cargando.....

Gracias lauser, también quiero que salga la barra de proceso cuando haga una petición de búsqueda a la base de datos. He puesto Pace.start(); pero no funciona. El archivo js lo he sacado de aquí:
https://raw.githubusercontent.com/Hu....0/pace.min.js

Código Javascript:
Ver original
  1. function filtrar(){
  2.  
  3. $.ajax({
  4. data: $("#frm_filtro").serialize()+ordenar,
  5. type: "POST",
  6. dataType: "json",
  7. url: "ajax_mobile.php?action=listar",
  8. beforeSend:function(){
  9. Pace.start();
  10. },
  11. complete: function() {
  12. Pace.stop();
  13. },
  14. success: function(data){
  15. var html_user ='' ;
  16. if(data.length > 0){
  17. $.each(data, function(i,item){



Gracias

Última edición por satjaen; 26/10/2015 a las 18:25
  #4 (permalink)  
Antiguo 27/10/2015, 02:28
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 3 meses
Puntos: 10
Respuesta: Efecto cargando.....

Y este es el css:

pace.css
Código CSS:
Ver original
  1. .pace {
  2.   -webkit-pointer-events: none;
  3.   pointer-events: none;
  4.  
  5.   -webkit-user-select: none;
  6.   -moz-user-select: none;
  7.   user-select: none;
  8.  
  9.   -webkit-box-sizing: border-box;
  10.   -moz-box-sizing: border-box;
  11.   -ms-box-sizing: border-box;
  12.   -o-box-sizing: border-box;
  13.   box-sizing: border-box;
  14.  
  15.   -webkit-border-radius: 10px;
  16.   -moz-border-radius: 10px;
  17.   border-radius: 10px;
  18.  
  19.   -webkit-background-clip: padding-box;
  20.   -moz-background-clip: padding;
  21.   background-clip: padding-box;
  22.  
  23.   z-index: 2000;
  24.   position: fixed;
  25.   margin: auto;
  26.   top: 12px;
  27.   left: 0;
  28.   right: 0;
  29.   bottom: 0;
  30.   width: 200px;
  31.   height: 50px;
  32.   overflow: hidden;
  33. }
  34.  
  35. .pace .pace-progress {
  36.   -webkit-box-sizing: border-box;
  37.   -moz-box-sizing: border-box;
  38.   -ms-box-sizing: border-box;
  39.   -o-box-sizing: border-box;
  40.   box-sizing: border-box;
  41.  
  42.   -webkit-border-radius: 2px;
  43.   -moz-border-radius: 2px;
  44.   border-radius: 2px;
  45.  
  46.   -webkit-background-clip: padding-box;
  47.   -moz-background-clip: padding;
  48.   background-clip: padding-box;
  49.  
  50.   -webkit-transform: translate3d(0, 0, 0);
  51.   transform: translate3d(0, 0, 0);
  52.  
  53.   display: block;
  54.   position: absolute;
  55.   right: 100%;
  56.   margin-right: -7px;
  57.   width: 93%;
  58.   top: 7px;
  59.   height: 14px;
  60.   font-size: 12px;
  61.   background: #29d;
  62.   color: #29d;
  63.   line-height: 60px;
  64.   font-weight: bold;
  65.   font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
  66.  
  67.   -webkit-box-shadow: 120px 0 #fff, 240px 0 #fff;
  68.   -ms-box-shadow: 120px 0 #fff, 240px 0 #fff;
  69.   box-shadow: 120px 0 #fff, 240px 0 #fff;
  70. }
  71.  
  72. .pace .pace-progress:after {
  73.   content: attr(data-progress-text);
  74.   display: inline-block;
  75.   position: fixed;
  76.   width: 45px;
  77.   text-align: right;
  78.   right: 0;
  79.   padding-right: 16px;
  80.   top: 4px;
  81. }
  82.  
  83. .pace .pace-progress[data-progress-text="0%"]:after { right: -200px }
  84. .pace .pace-progress[data-progress-text="1%"]:after { right: -198.14px }
  85. .pace .pace-progress[data-progress-text="2%"]:after { right: -196.28px }
  86. .pace .pace-progress[data-progress-text="3%"]:after { right: -194.42px }
  87. .pace .pace-progress[data-progress-text="4%"]:after { right: -192.56px }
  88. .pace .pace-progress[data-progress-text="5%"]:after { right: -190.7px }
  89. .pace .pace-progress[data-progress-text="6%"]:after { right: -188.84px }
  90. .pace .pace-progress[data-progress-text="7%"]:after { right: -186.98px }
  91. .pace .pace-progress[data-progress-text="8%"]:after { right: -185.12px }
  92. .pace .pace-progress[data-progress-text="9%"]:after { right: -183.26px }
  93. .pace .pace-progress[data-progress-text="10%"]:after { right: -181.4px }
  94. .pace .pace-progress[data-progress-text="11%"]:after { right: -179.54px }
  95. .pace .pace-progress[data-progress-text="12%"]:after { right: -177.68px }
  96. .pace .pace-progress[data-progress-text="13%"]:after { right: -175.82px }
  97. .pace .pace-progress[data-progress-text="14%"]:after { right: -173.96px }
  98. .pace .pace-progress[data-progress-text="15%"]:after { right: -172.1px }
  99. .pace .pace-progress[data-progress-text="16%"]:after { right: -170.24px }
  100. .pace .pace-progress[data-progress-text="17%"]:after { right: -168.38px }
  101. .pace .pace-progress[data-progress-text="18%"]:after { right: -166.52px }
  102. .pace .pace-progress[data-progress-text="19%"]:after { right: -164.66px }
  103. .pace .pace-progress[data-progress-text="20%"]:after { right: -162.8px }
  104. .pace .pace-progress[data-progress-text="21%"]:after { right: -160.94px }
  105. .pace .pace-progress[data-progress-text="22%"]:after { right: -159.08px }
  106. .pace .pace-progress[data-progress-text="23%"]:after { right: -157.22px }
  107. .pace .pace-progress[data-progress-text="24%"]:after { right: -155.36px }
  108. .pace .pace-progress[data-progress-text="25%"]:after { right: -153.5px }
  109. .pace .pace-progress[data-progress-text="26%"]:after { right: -151.64px }
  110. .pace .pace-progress[data-progress-text="27%"]:after { right: -149.78px }
  111. .pace .pace-progress[data-progress-text="28%"]:after { right: -147.92px }
  112. .pace .pace-progress[data-progress-text="29%"]:after { right: -146.06px }
  113. .pace .pace-progress[data-progress-text="30%"]:after { right: -144.2px }
  114. .pace .pace-progress[data-progress-text="31%"]:after { right: -142.34px }
  115. .pace .pace-progress[data-progress-text="32%"]:after { right: -140.48px }
  116. .pace .pace-progress[data-progress-text="33%"]:after { right: -138.62px }
  117. .pace .pace-progress[data-progress-text="34%"]:after { right: -136.76px }
  118. .pace .pace-progress[data-progress-text="35%"]:after { right: -134.9px }
  119. .pace .pace-progress[data-progress-text="36%"]:after { right: -133.04px }
  120. .pace .pace-progress[data-progress-text="37%"]:after { right: -131.18px }
  121. .pace .pace-progress[data-progress-text="38%"]:after { right: -129.32px }
  122. .pace .pace-progress[data-progress-text="39%"]:after { right: -127.46px }
  123. .pace .pace-progress[data-progress-text="40%"]:after { right: -125.6px }
  124. .pace .pace-progress[data-progress-text="41%"]:after { right: -123.74px }
  125. .pace .pace-progress[data-progress-text="42%"]:after { right: -121.88px }
  126. .pace .pace-progress[data-progress-text="43%"]:after { right: -120.02px }
  127. .pace .pace-progress[data-progress-text="44%"]:after { right: -118.16px }
  128. .pace .pace-progress[data-progress-text="45%"]:after { right: -116.3px }
  129. .pace .pace-progress[data-progress-text="46%"]:after { right: -114.44px }
  130. .pace .pace-progress[data-progress-text="47%"]:after { right: -112.58px }
  131. .pace .pace-progress[data-progress-text="48%"]:after { right: -110.72px }
  132. .pace .pace-progress[data-progress-text="49%"]:after { right: -108.86px }
  133. .pace .pace-progress[data-progress-text="50%"]:after { right: -107px }
  134. .pace .pace-progress[data-progress-text="51%"]:after { right: -105.14px }
  135. .pace .pace-progress[data-progress-text="52%"]:after { right: -103.28px }
  136. .pace .pace-progress[data-progress-text="53%"]:after { right: -101.42px }
  137. .pace .pace-progress[data-progress-text="54%"]:after { right: -99.56px }
  138. .pace .pace-progress[data-progress-text="55%"]:after { right: -97.7px }
  139. .pace .pace-progress[data-progress-text="56%"]:after { right: -95.84px }
  140. .pace .pace-progress[data-progress-text="57%"]:after { right: -93.98px }
  141. .pace .pace-progress[data-progress-text="58%"]:after { right: -92.12px }
  142. .pace .pace-progress[data-progress-text="59%"]:after { right: -90.26px }
  143. .pace .pace-progress[data-progress-text="60%"]:after { right: -88.4px }
  144. .pace .pace-progress[data-progress-text="61%"]:after { right: -86.53999999999999px }
  145. .pace .pace-progress[data-progress-text="62%"]:after { right: -84.68px }
  146. .pace .pace-progress[data-progress-text="63%"]:after { right: -82.82px }
  147. .pace .pace-progress[data-progress-text="64%"]:after { right: -80.96000000000001px }
  148. .pace .pace-progress[data-progress-text="65%"]:after { right: -79.1px }
  149. .pace .pace-progress[data-progress-text="66%"]:after { right: -77.24px }
  150. .pace .pace-progress[data-progress-text="67%"]:after { right: -75.38px }
  151. .pace .pace-progress[data-progress-text="68%"]:after { right: -73.52px }
  152. .pace .pace-progress[data-progress-text="69%"]:after { right: -71.66px }
  153. .pace .pace-progress[data-progress-text="70%"]:after { right: -69.8px }
  154. .pace .pace-progress[data-progress-text="71%"]:after { right: -67.94px }
  155. .pace .pace-progress[data-progress-text="72%"]:after { right: -66.08px }
  156. .pace .pace-progress[data-progress-text="73%"]:after { right: -64.22px }
  157. .pace .pace-progress[data-progress-text="74%"]:after { right: -62.36px }
  158. .pace .pace-progress[data-progress-text="75%"]:after { right: -60.5px }
  159. .pace .pace-progress[data-progress-text="76%"]:after { right: -58.64px }
  160. .pace .pace-progress[data-progress-text="77%"]:after { right: -56.78px }
  161. .pace .pace-progress[data-progress-text="78%"]:after { right: -54.92px }
  162. .pace .pace-progress[data-progress-text="79%"]:after { right: -53.06px }
  163. .pace .pace-progress[data-progress-text="80%"]:after { right: -51.2px }
  164. .pace .pace-progress[data-progress-text="81%"]:after { right: -49.34px }
  165. .pace .pace-progress[data-progress-text="82%"]:after { right: -47.480000000000004px }
  166. .pace .pace-progress[data-progress-text="83%"]:after { right: -45.62px }
  167. .pace .pace-progress[data-progress-text="84%"]:after { right: -43.76px }
  168. .pace .pace-progress[data-progress-text="85%"]:after { right: -41.9px }
  169. .pace .pace-progress[data-progress-text="86%"]:after { right: -40.04px }
  170. .pace .pace-progress[data-progress-text="87%"]:after { right: -38.18px }
  171. .pace .pace-progress[data-progress-text="88%"]:after { right: -36.32px }
  172. .pace .pace-progress[data-progress-text="89%"]:after { right: -34.46px }
  173. .pace .pace-progress[data-progress-text="90%"]:after { right: -32.6px }
  174. .pace .pace-progress[data-progress-text="91%"]:after { right: -30.740000000000002px }
  175. .pace .pace-progress[data-progress-text="92%"]:after { right: -28.880000000000003px }
  176. .pace .pace-progress[data-progress-text="93%"]:after { right: -27.02px }
  177. .pace .pace-progress[data-progress-text="94%"]:after { right: -25.16px }
  178. .pace .pace-progress[data-progress-text="95%"]:after { right: -23.3px }
  179. .pace .pace-progress[data-progress-text="96%"]:after { right: -21.439999999999998px }
  180. .pace .pace-progress[data-progress-text="97%"]:after { right: -19.58px }
  181. .pace .pace-progress[data-progress-text="98%"]:after { right: -17.72px }
  182. .pace .pace-progress[data-progress-text="99%"]:after { right: -15.86px }
  183. .pace .pace-progress[data-progress-text="100%"]:after { right: -14px }
  184.  
  185.  
  186. .pace .pace-activity {
  187.   position: absolute;
  188.   width: 100%;
  189.   height: 28px;
  190.   z-index: 2001;
  191.   box-shadow: inset 0 0 0 2px #29d, inset 0 0 0 7px #FFF;
  192.   border-radius: 10px;
  193. }
  194.  
  195. .pace.pace-inactive {
  196.   display: none;
  197. }
  #5 (permalink)  
Antiguo 27/10/2015, 12:23
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 3 meses
Puntos: 10
Respuesta: Efecto cargando.....

Por favor, alguien sabe como configurar Pace.start(); para que al hacer la petición al archivo php se vea la barra de progreso ?

pace.js
Código Javascript:
Ver original
  1. /*! pace 1.0.0 */
  2. (function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X=[].slice,Y={}.hasOwnProperty,Z=function(a,b){function c(){this.constructor=a}for(var d in b)Y.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},$=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(u={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},C=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},E=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,t=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==E&&(E=function(a){return setTimeout(a,50)},t=function(a){return clearTimeout(a)}),G=function(a){var b,c;return b=C(),(c=function(){var d;return d=C()-b,d>=33?(b=C(),a(d,function(){return E(c)})):setTimeout(c,33-d)})()},F=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?X.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},v=function(){var a,b,c,d,e,f,g;for(b=arguments[0],d=2<=arguments.length?X.call(arguments,1):[],f=0,g=d.length;g>f;f++)if(c=d[f])for(a in c)Y.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?v(b[a],e):b[a]=e);return b},q=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},x=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];c<this.bindings[a].length;)e.push(this.bindings[a][c].handler===b?this.bindings[a].splice(c,1):c++);return e}},a.prototype.trigger=function(){var a,b,c,d,e,f,g,h,i;if(c=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],null!=(g=this.bindings)?g[c]:void 0){for(e=0,i=[];e<this.bindings[c].length;)h=this.bindings[c][e],d=h.handler,b=h.ctx,f=h.once,d.apply(null!=b?b:this,a),i.push(f?this.bindings[c].splice(e,1):e++);return i}},a}(),j=window.Pace||{},window.Pace=j,v(j,g.prototype),D=j.options=v({},u,window.paceOptions,x()),U=["ajax","document","eventLag","elements"],Q=0,S=U.length;S>Q;Q++)K=U[Q],D[K]===!0&&(D[K]=u[K]);i=function(a){function b(){return V=b.__super__.constructor.apply(this,arguments)}return Z(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(a=document.querySelector(D.target),!a)throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='<div class="pace-progress">\n  <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return a=this.getElement(),a.className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b,c,d,e,f,g;if(null==document.querySelector(D.target))return!1;for(a=this.getElement(),d="translate3d("+this.progress+"%, 0, 0)",g=["webkitTransform","msTransform","transform"],e=0,f=g.length;f>e;e++)b=g[e],a.children[0].style[b]=d;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?c="99":(c=this.progress<10?"0":"",c+=0|this.progress),a.children[0].setAttribute("data-progress",""+c)),this.lastRenderedProgress=this.progress},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(f=this.bindings[a],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),P=window.XMLHttpRequest,O=window.XDomainRequest,N=window.WebSocket,w=function(a,b){var c,d,e,f;f=[];for(d in b.prototype)try{e=b.prototype[d],f.push(null==a[d]&&"function"!=typeof e?a[d]=e:void 0)}catch(g){c=g}return f},A=[],j.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("ignore"),c=b.apply(null,a),A.shift(),c},j.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("track"),c=b.apply(null,a),A.shift(),c},J=function(a){var b;if(null==a&&(a="GET"),"track"===A[0])return"force";if(!A.length&&D.ajax){if("socket"===a&&D.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),$.call(D.ajax.trackMethods,b)>=0)return!0}return!1},k=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return J(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new P(b),a(c),c};try{w(window.XMLHttpRequest,P)}catch(d){}if(null!=O){window.XDomainRequest=function(){var b;return b=new O,a(b),b};try{w(window.XDomainRequest,O)}catch(d){}}if(null!=N&&D.ajax.trackWebSockets){window.WebSocket=function(a,b){var d;return d=null!=b?new N(a,b):new N(a),J("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d};try{w(window.WebSocket,N)}catch(d){}}}return Z(b,a),b}(h),R=null,y=function(){return null==R&&(R=new k),R},I=function(a){var b,c,d,e;for(e=D.ajax.ignoreURLs,c=0,d=e.length;d>c;c++)if(b=e[c],"string"==typeof b){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},y().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,I(g)?void 0:j.running||D.restartOnRequestAfter===!1&&"force"!==J(f)?void 0:(d=arguments,c=D.restartOnRequestAfter||0,"boolean"==typeof c&&(c=0),setTimeout(function(){var b,c,g,h,i,k;if(b="socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(j.restart(),i=j.sources,k=[],c=0,g=i.length;g>c;c++){if(K=i[c],K instanceof a){K.watch.apply(K,d);break}k.push(void 0)}return k}},c))}),a=function(){function a(){var a=this;this.elements=[],y().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,I(e)?void 0:(c="socket"===d?new n(b):new o(b),this.elements.push(c))},a}(),o=function(){function a(a){var b,c,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(c=null,a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2},!1),g=["load","abort","timeout","error"],d=0,e=g.length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100},!1);else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}return a}(),n=function(){function a(a){var b,c,d,e,f=this;for(this.progress=0,e=["error","open"],c=0,d=e.length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100},!1)}return a}(),d=function(){function a(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),f=a.selectors,c=0,d=f.length;d>c;c++)b=f[c],this.elements.push(new e(b))}return a}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},D.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){function a(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=C(),b=setInterval(function(){var g;return g=C()-c-50,c=C(),e.push(g),e.length>D.eventLag.sampleCount&&e.shift(),a=q(e),++d>=D.eventLag.minSamples&&a<D.eventLag.lagThreshold?(f.progress=100,clearInterval(b)):f.progress=100*(3/(a+3))},50)}return a}
  #6 (permalink)  
Antiguo 27/10/2015, 12:24
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 3 meses
Puntos: 10
Respuesta: Efecto cargando.....

Continuación de pace.js

Código Javascript:
Ver original
  1. (),m=function(){function a(a){this.source=a,this.last=this.sinceLastUpdate=0,this.rate=D.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=F(this.source,"progress"))}return a.prototype.tick=function(a,b){var c;return null==b&&(b=F(this.source,"progress")),b>=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/D.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,D.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+D.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),L=null,H=null,r=null,M=null,p=null,s=null,j.running=!1,z=function(){return D.restartOnPushState?j.restart():void 0},null!=window.history.pushState&&(T=window.history.pushState,window.history.pushState=function(){return z(),T.apply(window.history,arguments)}),null!=window.history.replaceState&&(W=window.history.replaceState,window.history.replaceState=function(){return z(),W.apply(window.history,arguments)}),l={ajax:a,elements:d,document:c,eventLag:f},(B=function(){var a,c,d,e,f,g,h,i;for(j.sources=L=[],g=["ajax","elements","document","eventLag"],c=0,e=g.length;e>c;c++)a=g[c],D[a]!==!1&&L.push(new l[a](D[a]));for(i=null!=(h=D.extraSources)?h:[],d=0,f=i.length;f>d;d++)K=i[d],L.push(new K(D));return j.bar=r=new b,H=[],M=new m})(),j.stop=function(){return j.trigger("stop"),j.running=!1,r.destroy(),s=!0,null!=p&&("function"==typeof t&&t(p),p=null),B()},j.restart=function(){return j.trigger("restart"),j.stop(),j.start()},j.go=function(){var a;return j.running=!0,r.render(),a=C(),s=!1,p=G(function(b,c){var d,e,f,g,h,i,k,l,n,o,p,q,t,u,v,w;for(l=100-r.progress,e=p=0,f=!0,i=q=0,u=L.length;u>q;i=++q)for(K=L[i],o=null!=H[i]?H[i]:H[i]=[],h=null!=(w=K.elements)?w:[K],k=t=0,v=h.length;v>t;k=++t)g=h[k],n=null!=o[k]?o[k]:o[k]=new m(g),f&=n.done,n.done||(e++,p+=n.tick(b));return d=p/e,r.update(M.tick(b,d)),r.done()||f||s?(r.update(100),j.trigger("done"),setTimeout(function(){return r.finish(),j.running=!1,j.trigger("hide")},Math.max(D.ghostTime,Math.max(D.minTime-(C()-a),0)))):c()})},j.start=function(a){v(D,a),j.running=!0;try{r.render()}catch(b){i=b}return document.querySelector(".pace")?(j.trigger("start"),j.go()):setTimeout(j.start,50)},"function"==typeof define&&define.amd?define(function(){return j}):"object"==typeof exports?module.exports=j:D.startOnPageLoad&&j.start()}).call(this);

Gracias

Etiquetas: efecto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:18.