1$().ready(function () { 2 //handle putting the chevron in the right place no matter what their browsing width 3 $(".bannerChevron,.alertsContent").css('right', Math.floor(($('body').width() - 960) / 2) + 10); 4 window.onresize = function () { 5 $(".bannerChevron,.alertsContent").css('right', Math.floor(($('body').width() - 960) / 2) + 10); 6 } 7 8 //move the background of the page down as much as the chevron is down 9 //ie8 fix because ie8 doesn't recognize 'background-position' so I use 'background-position-y' 10 var backgroundY; 11 if (!!$("body").css("background-position")) { 12 backgroundY = Number($("body").css("background-position").split(' ')[1].replace('px', '')); 13 backgroundY += $(".bannerContainer").height(); 14 $("body").css("background-position", "0 " + backgroundY + "px"); 15 } else { 16 backgroundY = Number($("body").css("background-position-y").replace('px', '')); 17 backgroundY += $(".bannerContainer").height(); 18 $("body").css("background-position-y", "0 " + backgroundY + "px"); 19 } 20 21 $("#closeBanner").click(function () { 22 var bannerId = $(this).attr('bannerId') 23 $.ajax({ url: '/Home/DismissBanner/' + bannerId }); 24 var backgroundY; 25 //ie8 fix: see above 26 if (!!$("body").css("background-position")) { 27 backgroundY = Number($("body").css("background-position").split(' ')[1].replace('px', '')); 28 } else { 29 backgroundY = Number($("body").css("background-position-y").replace('px', '')); 30 } 31 backgroundY -= $(".bannerContainer").height(); 32 33 $(".bannerContainer").animate({ height: '0' }, 500, function () { 34 $(".alertsbanner").css('display', 'none'); 35 }); 36 37 //$('body').animate({ backgroundPosition: "0 " + backgroundY + "px" }, 500, function () { }); // adgh 5-12-2014 no longer required 38 39 return false; 40 }) 41}); 42//shamelessly stole this background animation fix from http://stackoverflow.com/a/6280048 43(function ($) { 44 if (!document.defaultView || !document.defaultView.getComputedStyle) { 45 var oldCSS = jQuery.css; 46 jQuery.css = function (elem, name, force) { 47 if (name === 'background-position') { 48 name = 'backgroundPosition'; 49 } 50 if (name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[name]) { 51 return oldCSS.apply(this, arguments); 52 } 53 var style = elem.style; 54 if (!force && style && style[name]) { 55 return style[name]; 56 } 57 return oldCSS(elem, 'backgroundPositionX', force) + ' ' + oldCSS(elem, 'backgroundPositionY', force); 58 }; 59 } 60 61 var oldAnim = $.fn.animate; 62 $.fn.animate = function (prop) { 63 if ('background-position' in prop) { 64 prop.backgroundPosition = prop['background-position']; 65 delete prop['background-position']; 66 } 67 if ('backgroundPosition' in prop) { 68 prop.backgroundPosition = '(' + prop.backgroundPosition + ')'; 69 } 70 return oldAnim.apply(this, arguments); 71 }; 72 73 function toArray(strg) { 74 strg = strg.replace(/left|top/g, '0px'); 75 strg = strg.replace(/right|bottom/g, '100%'); 76 strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g, "$1px$2"); 77 var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/); 78 return [parseFloat(res[1], 10), res[2], parseFloat(res[3], 10), res[4]]; 79 } 80 81 $.fx.step.backgroundPosition = function (fx) { 82 if (!fx.bgPosReady) { 83 var start = $.css(fx.elem, 'backgroundPosition'); 84 85 if (!start) {//FF2 no inline-style fallback 86 start = '0px 0px'; 87 } 88 89 start = toArray(start); 90 91 fx.start = [start[0], start[2]]; 92 93 var end = toArray(fx.end); 94 fx.end = [end[0], end[2]]; 95 96 fx.unit = [end[1], end[3]]; 97 fx.bgPosReady = true; 98 } 99 100 var nowPosX = []; 101 nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0]; 102 nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1]; 103 fx.elem.style.backgroundPosition = nowPosX[0] + ' ' + nowPosX[1]; 104 }; 105})(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.