1function imageTooltip(el) { 2var dw = jQuery(window).width(), 3 dh = jQuery(window).height(), 4 iw, ih, pt, pl; 5 6 jQuery('.imageHolder').remove(); 7 jQuery('body').append('<div class="imageHolder"></div>'); 8 jQuery('.imageHolder').css('position', 'absolute').css('display', 'none').css('zindex',10001); 9 10 el.each(function() { 11 jQuery(this).hover(function (e) { 12 var el = jQuery(this), 13 src = el.attr('id'), 14 img = new Image(); 15 dh = jQuery(window).height(); 16 dw = jQuery(window).width(); 17 dh = jQuery(window).height(); 18 el.css('cursor', 'progress'); 19 jQuery('.imageHolder img').remove(); 20 jQuery(img).load(function () { 21 el.css('cursor', 'default'); 22 jQuery('.imageHolder').append(this); 23 iw = jQuery('.imageHolder').width(); 24 ih = jQuery('.imageHolder').height(); 25 //check if image larger than dh 26 if (ih > dh) { 27 jQuery('.imageHolder img').height(dh-40); 28 ih = dh-40; 29 } 30 //check if image larger than dw 31 if (iw > dw) { 32 jQuery('.imageHolder img').width(dw-40); 33 iw = dw-40; 34 } 35 }).error(function () { 36 alert('Error loading image.'); 37 }).attr('src', src); 38 },function () { 39 //jQuery('.imageHolder img').fadeOut(300, function() {jQuery(this).remove()}); 40 jQuery('.imageHolder img').hide().remove(); 41 }).mousemove(function (e) { 42 ih = jQuery('.imageHolder').height(); 43 iw = jQuery('.imageHolder').width(); 44 //if image height not fits to bottom 45 var out = e.pageY+ih-jQuery(document).scrollTop()-dh; 46 //check if image not fits to window 47 if (e.pageY+ih-jQuery(document).scrollTop()>dh) { 48 jQuery('.imageHolder').css('top', e.pageY-out-20); 49 } else { 50 jQuery('.imageHolder').css('top', e.pageY-20); 51 } 52 //check if image on the right and not fits 53 if (e.pageX+iw > dw-20) { 54 jQuery('.imageHolder').css('left', e.pageX-iw-20); 55 } 56 else { 57 jQuery('.imageHolder').css('left', e.pageX+20); 58 } 59 if (!jQuery('.imageHolder').is(':visible')) { 60 jQuery('.imageHolder').fadeIn(200); 61 } 62 }); 63 }) 64}
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.