1 2$(document).ready(function(){ 3$(window).bind("resize",function(){ 4if($(this).width() <= 767){ 5$('.dp_milestone_14 .equal-height-container .order-6').slice().insertBefore('.dp_milestone_14 .equal-height-container .order-5') 6 7$('.dp_milestone_14 .equal-height-container .order-4').slice().insertAfter('.dp_milestone_14 .equal-height-container .order-5') 8 9} 10 11}); 12}); 13 14 15 16$(window).load(function(){ 17if ($(window).width() <= 767) { 18$('.dp_milestone_14 .equal-height-container .order-6').slice().insertBefore('.dp_milestone_14 .equal-height-container .order-5') 19 20$('.dp_milestone_14 .equal-height-container .order-4').slice().insertAfter('.dp_milestone_14 .equal-height-container .order-5') 21 22}; 23}); 24 25 26// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel // MIT license 27(function() { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; } if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(id) { clearTimeout(id); }; }()); 28(function() { 29 30var FULL_TIME = 2000; //ms 31var allGroups = $(".circle-group"); 32var delayPerItem = FULL_TIME / allGroups.length; 33 34allGroups.each(function() { 35 var rtElem = $(".widget-type-rich_text", this); 36 var origHtml = rtElem.html(); 37 var percentage; 38 var newHtml = origHtml.replace(/(\d+)%/, function(_, p) { 39 percentage = parseInt(p) / 100; 40 return "<span class='percentage'>0</span>%"; 41 }); 42 rtElem.html(newHtml).show(); 43 var percentageElem = rtElem.find(".percentage"); 44 var svgBar = $("svg .bar", this); 45 var barFullLength = parseFloat(svgBar.attr("stroke-dasharray")); 46 var length = FULL_TIME * percentage; 47 var delay = delayPerItem * allGroups.index(this); 48 var start = null; 49 var step = function(timestamp) { 50 if (!start) { 51 start = timestamp; 52 } 53 var curRatio = Math.min(1, Math.max(0, timestamp - delay - start) / length); 54 percentageElem.text(Math.floor(percentage * curRatio * 100)); 55 svgBar.css("strokeDashoffset", barFullLength * (1 - curRatio * percentage)); 56 if (curRatio < 1) { 57 window.requestAnimationFrame(step); 58 } 59 }; 60 $(this).on("wowShow", function() { 61 window.requestAnimationFrame(step); 62 }); 63}); 64 65})(); 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.