1// zoomi - A zoom for images ~ Sean Catchpole - Version 0.9 2(function($){ 3 4$.fn.zoomi = function() { 5 $(this).filter("img").each(function(){ 6 if(!this.z) { 7 $(this).zoom1().mouseover(function(){$(this).zoom2().show();}); 8 $(this.z).mouseout(function(){$(this).hide();}); } 9 }); 10 return this; 11} 12 13$.fn.zoom1 = function() { 14 $(this).each(function(){ 15 var e = this; 16 $(e).css({'position':'relative','z-index':'8'}).after('<img class="'+e.className+'">'); 17 e.z = e.nextSibling; 18 $(e.z).removeClass("zoomi").addClass("zoom2").attr("src",e.alt || e.src) 19 .css({'position':'absolute','z-index':'10'}); 20 $(e.z).hide(); 21 }); 22 return this; 23} 24 25$.fn.zoom2 = function() { 26 var s = []; 27 this.each(function(){ 28 var e = this; 29 if(!e.z) e = $(e).zoom1()[0]; s.push(e.z); 30 if(!e.z.complete) return; 31 if(!e.z.width) { $(e.z).show(); e.z.width=e.z.width; $(e.z).hide(); } 32 $(e.z).css({left:$(e).offsetLeft()-(e.z.width-e.scrollWidth)/2+'px', 33 top:$(e).offsetTop()-(e.z.height-e.scrollHeight)/2+'px'}); 34 }); 35 return this.pushStack(s); 36} 37 38$.fn.offsetLeft = function() { 39 var e = this[0]; 40 if(!e.offsetParent) return e.offsetLeft; 41 return e.offsetLeft + $(e.offsetParent).offsetLeft(); } 42 43$.fn.offsetTop = function() { 44 var e = this[0]; 45 if(!e.offsetParent) return e.offsetTop; 46 return e.offsetTop + $(e.offsetParent).offsetTop(); } 47 48$(function(){ $('img.zoomi').zoomi(); }); 49 50})(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.