/* * jQuery UI Magnifier * * Copyright (c) 2008 jQuery * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Magnifier * * Depends: * ui.core.js */ (function($) { $.widget("ui.magnifier", { init: function() { var self = this, o = this.options; this.items = []; this.element.addClass("ui-magnifier"); if(!(/^(r|a)/).test(this.element.css("position"))) this.element.css("position", "relative"); this.pp = this.element.offset(); $(o.items, this.element).each(function() { self.items.push([ this, $(this).offset(), [$(this).width(),$(this).height()], (o.overlap ? $(this).position() : null) ]); if(o.opacity) $(this).css('opacity', o.opacity.min); }); if(o.overlap) { for(var i=0;i this.pp.left-o.distance && p[0] < this.pp.left + this.element[0].offsetWidth + o.distance) && (p[1] > this.pp.top-o.distance && p[1] < this.pp.top + this.element[0].offsetHeight + o.distance)); if(!overlap) return false; for(var i=0;i *" } }); })(jQuery);