blob: 4c63197ad618b635f5fdcc9c678a0407d9c7529b [file] [log] [blame]
$.fn.magnifierRentgen=function(){return this.each(function(){var i=$(this),e=i.data("image"),n=i.data("image-zoom"),t=i.data("size");i.addClass("magnifierRentgen").resize(function(){i.find(".data-image, .magnifier-loupe img").css({width:i.width()})}).append("\r\n <img class='data-image' src='"+e+"'>\r\n <div class='magnifier-loupe'>\r\n <img src='"+n+"'>\r\n ").hover(function(){i.find(".magnifier-loupe").stop().fadeIn()},function(){i.find(".magnifier-loupe").stop().fadeOut()}).find(".data-image").css({width:i.width()}).parent().find(".magnifier-loupe").css({width:t,height:t}).find("img").css({position:"absolute",width:i.width()}),i.mousemove(function(e){var n={},a=i.offset();n={left:e.pageX-a.left-t/2,top:e.pageY-a.top-t/2},i.find(".magnifier-loupe").css({top:n.top,left:n.left}).find("img").css({top:-n.top,left:-n.left,width:i.width()})}),$(window).resize(function(){$(".magnifierRentgen").resize()})})};