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