1(function($){ 2$.fn.jqueryzoom=function(options){ 3var settings={ 4xzoom:200, 5yzoom:200, 6offset:10, 7position:"right", 8lens:1, 9preload:1}; 10if(options){ 11$.extend(settings,options);} 12var noalt=''; 13$(this).hover(function(){ 14var imageLeft=$(this).offset().left; 15var imageTop=$(this).offset().top; 16var imageWidth=$(this).children('img').get(0).offsetWidth; 17var imageHeight=$(this).children('img').get(0).offsetHeight; 18noalt=$(this).children("img").attr("alt"); 19var bigimage=$(this).children("img").attr("jqimg"); 20$(this).children("img").attr("alt",''); 21if($("div.zoomdiv").get().length==0){ 22$(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage+"'/></div>"); 23$(this).append("<div class='jqZoomPup'> </div>");} 24if(settings.position=="right"){ 25if(imageLeft+imageWidth+settings.offset+settings.xzoom>screen.width){ 26leftpos=imageLeft-settings.offset-settings.xzoom;}else{ 27leftpos=imageLeft+imageWidth+settings.offset;}}else{ 28leftpos=imageLeft-settings.xzoom-settings.offset; 29if(leftpos<0){ 30leftpos=imageLeft+imageWidth+settings.offset;}} 31$("div.zoomdiv").css({top:imageTop,left:leftpos}); 32$("div.zoomdiv").width(settings.xzoom); 33$("div.zoomdiv").height(settings.yzoom); 34$("div.zoomdiv").show(); 35if(!settings.lens){ 36$(this).css('cursor','crosshair');} 37$(document.body).mousemove(function(e){ 38mouse=new MouseEvent(e); 39var bigwidth=$(".bigimg").get(0).offsetWidth; 40var bigheight=$(".bigimg").get(0).offsetHeight; 41var scaley='x'; 42var scalex='y'; 43if(isNaN(scalex)|isNaN(scaley)){ 44var scalex=(bigwidth/imageWidth); 45var scaley=(bigheight/imageHeight); 46$("div.jqZoomPup").width((settings.xzoom)/(scalex*1)); 47$("div.jqZoomPup").height((settings.yzoom)/(scaley*1)); 48if(settings.lens){ 49$("div.jqZoomPup").css('visibility','visible');}} 50xpos=mouse.x-$("div.jqZoomPup").width()/2-imageLeft; 51ypos=mouse.y-$("div.jqZoomPup").height()/2-imageTop; 52if(settings.lens){ 53xpos=(mouse.x-$("div.jqZoomPup").width()/2 < imageLeft ) ? 0 : (mouse.x + $("div.jqZoomPup").width()/2>imageWidth+imageLeft)?(imageWidth-$("div.jqZoomPup").width()-2):xpos; 54ypos=(mouse.y-$("div.jqZoomPup").height()/2 < imageTop ) ? 0 : (mouse.y + $("div.jqZoomPup").height()/2>imageHeight+imageTop)?(imageHeight-$("div.jqZoomPup").height()-2):ypos;} 55if(settings.lens){ 56$("div.jqZoomPup").css({top:ypos,left:xpos});} 57scrolly=ypos; 58$("div.zoomdiv").get(0).scrollTop=scrolly*scaley; 59scrollx=xpos; 60$("div.zoomdiv").get(0).scrollLeft=(scrollx)*scalex;});},function(){ 61$(this).children("img").attr("alt",noalt); 62$(document.body).unbind("mousemove"); 63if(settings.lens){ 64$("div.jqZoomPup").remove();} 65$("div.zoomdiv").remove();}); 66count=0; 67if(settings.preload){ 68$('body').append("<div style='display:none;' class='jqPreload"+count+"'>360buy</div>"); 69$(this).each(function(){ 70var imagetopreload=$(this).children("img").attr("jqimg"); 71var content=jQuery('div.jqPreload'+count+'').html(); 72jQuery('div.jqPreload'+count+'').html(content+'<img src=\"'+imagetopreload+'\">');});}}})(jQuery); 73function MouseEvent(e){ 74this.x=e.pageX; 75this.y=e.pageY;}
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.