1/** 2 * æ°åæ»å¨js 3 * @param {Object} $ 4 */ 5(function($) { 6 if (!document.defaultView || !document.defaultView.getComputedStyle) { 7 var oldCurCSS = jQuery.curCSS; 8 jQuery.curCSS = function(elem, name, force) { 9 if (name === 'background-position') { 10 name = 'backgroundPosition'; 11 } 12 if (name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[name]) { 13 return oldCurCSS.apply(this, arguments); 14 } 15 var style = elem.style; 16 if (!force && style && style[name]) { 17 return style[name]; 18 } 19 return oldCurCSS(elem, 'backgroundPositionX', force) + ' ' + oldCurCSS(elem, 'backgroundPositionY', force); 20 }; 21 } 22 23 var oldAnim = $.fn.animate; 24 $.fn.animate = function(prop) { 25 if ('background-position' in prop) { 26 prop.backgroundPosition = prop['background-position']; 27 delete prop['background-position']; 28 } 29 if ('backgroundPosition' in prop) { 30 prop.backgroundPosition = '(' + prop.backgroundPosition + ')'; 31 } 32 return oldAnim.apply(this, arguments); 33 }; 34 35 function toArray(strg) { 36 strg = strg.replace(/left|top/g, '0px'); 37 strg = strg.replace(/right|bottom/g, '100%'); 38 strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g, "$1px$2"); 39 var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/); 40 return [parseFloat(res[1], 10), res[2], parseFloat(res[3], 10), res[4]]; 41 } 42 43 $.fx.step.backgroundPosition = function(fx) { 44 if (!fx.bgPosReady) { 45 var start = $.css(fx.elem, 'backgroundPosition'); 46 47 if (!start) { //FF2 no inline-style fallback 48 start = '0px 0px'; 49 } 50 51 start = toArray(start); 52 53 fx.start = [start[0], start[2]]; 54 55 var end = toArray(fx.end); 56 fx.end = [end[0], end[2]]; 57 58 fx.unit = [end[1], end[3]]; 59 fx.bgPosReady = true; 60 } 61 62 var nowPosX = []; 63 nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0]; 64 nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1]; 65 fx.elem.style.backgroundPosition = nowPosX[0] + ' ' + nowPosX[1]; 66 }; 67})(jQuery);
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.