Changeset 5838
- Timestamp:
- 08/24/08 22:01:10 (5 months ago)
- Location:
- trunk/plugins/tooltip
- Files:
-
- 5 modified
-
demo/index.html (modified) (1 diff)
-
jquery.tooltip.js (modified) (1 diff)
-
jquery.tooltip.min.js (modified) (3 diffs)
-
jquery.tooltip.pack.js (modified) (2 diffs)
-
jquery.tooltip.zip (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/tooltip/demo/index.html
r5341 r5838 120 120 <img id="tonus" src="image.png" height="80" title="No delay. The src value is displayed below the title" /> 121 121 <h3>Code</h3> 122 <pre><code class="mix">$('img').tooltip({ 123 delay: 0 122 <pre><code class="mix">$('#tonus').tooltip({ 123 delay: 0, 124 showURL: false, 125 bodyHandler: function() { 126 return $("<img/>").attr("src", this.src); 127 } 124 128 });</code></pre> 125 129 </fieldset> -
trunk/plugins/tooltip/jquery.tooltip.js
r5741 r5838 1 1 /* 2 * jQuery Tooltip plugin 1.3 pre2 * jQuery Tooltip plugin 1.3 3 3 * 4 4 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ -
trunk/plugins/tooltip/jquery.tooltip.min.js
r5642 r5838 1 1 /* 2 * jQuery Tooltip plugin 1.3 pre2 * jQuery Tooltip plugin 1.3 3 3 * 4 4 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ … … 7 7 * Copyright (c) 2006 - 2008 Jörn Zaefferer 8 8 * 9 * $Id: jquery.tooltip.js 5 637 2008-05-19 21:51:26Z joern.zaefferer $9 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $ 10 10 * 11 11 * Dual licensed under the MIT and GPL licenses: … … 14 14 */;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else 15 15 show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else 16 helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if( settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else17 helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if( tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else16 helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else 17 helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else 18 18 helper.parent.stop().fadeOut(tsettings.fade,complete);}else 19 complete();if(settings(this).fixPNG)helper.parent.unfixPNG();} $.fn.Tooltip=$.fn.tooltip;})(jQuery);19 complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery); -
trunk/plugins/tooltip/jquery.tooltip.pack.js
r5642 r5838 1 1 /* 2 * jQuery Tooltip plugin 1.3 pre2 * jQuery Tooltip plugin 1.3 3 3 * 4 4 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ … … 13 13 * http://www.gnu.org/licenses/gpl.html 14 14 */ 15 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';( 7($){k e={},9,l,A,N=$.2v.2h&&/29\\s(5\\.5|6\\.)/.1M(1H.2u),I=10;$.j={w:10,1h:{14:25,r:10,1c:18,W:"",E:15,F:15,13:"j"},2t:7(){$.j.w=!$.j.w}};$.L.1u({j:7(a){a=$.1u({},$.j.1h,a);1q(a);f 2.D(7(){$.1j(2,"j",a);2.Z=e.3.m("1g");2.11=2.l;$(2).24("l");2.22=""}).21(1d).1U(o).1S(o)},G:N?7(){f 2.D(7(){k b=$(2).m(\'X\');4(b.1J(/^q\\(["\']?(.*\\.1I)["\']?\\)$/i)){b=1F.$1;$(2).m({\'X\':\'1D\',\'1C\':"2s:2r.2n.2m(2k=18, 2j=2i, 1p=\'"+b+"\')"}).D(7(){k a=$(2).m(\'1o\');4(a!=\'2g\'&&a!=\'1v\')$(2).m(\'1o\',\'1v\')})}})}:7(){f 2},1l:N?7(){f 2.D(7(){$(2).m({\'1C\':\'\',X:\'\'})})}:7(){f 2},1y:7(){f 2.D(7(){$(2)[$(2).C()?"n":"o"]()})},q:7(){f 2.1k(\'28\')||2.1k(\'1p\')}});7 1q(a){4(e.3)f;e.3=$(\'<t 13="\'+a.13+\'"><Y></Y><t 1i="g"></t><t 1i="q"></t></t>\').27(K.g).o();4($.L.1f)e.3.1f();e.l=$(\'Y\',e.3);e.g=$(\'t.g\',e.3);e.q=$(\'t.q\',e.3)}7 8(a){f $.1j(a,"j")}7 1e(a){4(8(2).14)A=26(n,8(2).14);p n();I=!!8(2).I;$(K.g).23(\'V\',u);u(a)}7 1d(){4($.j.w||2==9||(!2.11&&!8(2).T))f;9=2;l=2.11;4(8(2).T){e.l.o();k a=8(2).T.1Z(2);4(a.1Y||a.1V){e.g.1b().S(a)}p{e.g.C(a)}e.g.n()}p 4(8(2).17){k b=l.1T(8(2).17);e.l.C(b.1R()).n();e.g.1b();1Q(k i=0,Q;(Q=b[i]);i++){4(i>0)e.g.S("<1P/>");e.g.S(Q)}e.g.1y()}p{e.l.C(l).n();e.g.o()}4(8(2).1c&&$(2).q())e.q.C($(2).q().1O(\'1N://\',\'\')).n();p e.q.o();e.3.O(8(2).W);4(8(2).G)e.3.G();1e.1L(2,1K)}7 n(){A=R;4(8(9).r){4(e.3.H(":16"))e.3.P().n().M(8(9).r,9.Z);p e.3.H(\':19\')?e.3.M(8(9).r,9.Z):e.3.1G(8(9).r)}p{e.3.n()}u()}7 u(c){4($.j.w)f;4(c&&c.1W.1X=="1E"){f}4(!I&&e.3.H(":19")){$(K.g).1a(\'V\',u)}4(9==R){$(K.g).1a(\'V\',u);f}e.3.U("z-12").U("z-1B");k b=e.3[0].1A;k a=e.3[0].1z;4(c){b=c.2q+8(9).F;a=c.2o+8(9).E;k d=\'1x\';4(8(9).2l){d=$(B).1t()-b;b=\'1x\'}e.3.m({F:b,12:d,E:a})}k v=z(),h=e.3[0];4(v.x+v.1s<h.1A+h.1r){b-=h.1r+20+8(9).F;e.3.m({F:b+\'1m\'}).O("z-12")}4(v.y+v.1w<h.1z+h.1n){a-=h.1n+20+8(9).E;e.3.m({E:a+\'1m\'}).O("z-1B")}}7 z(){f{x:$(B).2f(),y:$(B).2e(),1s:$(B).1t(),1w:$(B).2p()}}7 o(a){4($.j.w)f;4(A)2d(A);9=R;k b=8(2);7 J(){e.3.U(b.W).o().m("1g","")}4(b.r){4(e.3.H(\':16\'))e.3.P().M(b.r,0,J);p e.3.P().2c(b.r,J)}p J();4(8(2).G)e.3.1l()}$.L.2b=$.L.j})(2a);',62,156,'||this|parent|if|||function|settings|current||||||return|body|||tooltip|var|title|css|show|hide|else|url|fade||div|update||blocked|||viewport|tID|window|html|each|top|left|fixPNG|is|track|complete|document|fn|fadeTo|IE|addClass|stop|part|null|append|bodyHandler|removeClass|mousemove|extraClass|backgroundImage|h3|tOpacity|false|tooltipText|right|id|delay||animated|showBody|true|visible|unbind|empty|showURL|save|handle|bgiframe|opacity|defaults|class|data|attr|unfixPNG|px|offsetHeight|position|src|createHelper|offsetWidth|cx|width|extend|relative|cy|auto|hideWhenEmpty|offsetTop|offsetLeft|bottom|filter|none|OPTION|RegExp|fadeIn|navigator|png|match|arguments|apply|test|http|replace|br|for|shift|click|split|mouseout|jquery|target|tagName|nodeType|call||mouseover|alt|bind|removeAttr|200|setTimeout|appendTo|href|MSIE|jQuery|Tooltip|fadeOut|clearTimeout|scrollTop|scrollLeft|absolute|msie|crop|sizingMethod|enabled|positionLeft|AlphaImageLoader|Microsoft|pageY|height|pageX|DXImageTransform|progid|block|userAgent|browser'.split('|'),0,{}))15 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(8($){j e={},9,m,B,A=$.2u.2g&&/29\\s(5\\.5|6\\.)/.1M(1H.2t),M=12;$.k={w:12,1h:{Z:25,r:12,1d:19,X:"",G:15,E:15,16:"k"},2s:8(){$.k.w=!$.k.w}};$.N.1v({k:8(a){a=$.1v({},$.k.1h,a);1q(a);g 2.F(8(){$.1j(2,"k",a);2.11=e.3.n("1g");2.13=2.m;$(2).24("m");2.22=""}).21(1e).1U(q).1S(q)},H:A?8(){g 2.F(8(){j b=$(2).n(\'Y\');4(b.1J(/^o\\(["\']?(.*\\.1I)["\']?\\)$/i)){b=1F.$1;$(2).n({\'Y\':\'1D\',\'1B\':"2r:2q.2m.2l(2j=19, 2i=2h, 1p=\'"+b+"\')"}).F(8(){j a=$(2).n(\'1o\');4(a!=\'2f\'&&a!=\'1u\')$(2).n(\'1o\',\'1u\')})}})}:8(){g 2},1l:A?8(){g 2.F(8(){$(2).n({\'1B\':\'\',Y:\'\'})})}:8(){g 2},1x:8(){g 2.F(8(){$(2)[$(2).D()?"l":"q"]()})},o:8(){g 2.1k(\'28\')||2.1k(\'1p\')}});8 1q(a){4(e.3)g;e.3=$(\'<t 16="\'+a.16+\'"><10></10><t 1i="f"></t><t 1i="o"></t></t>\').27(K.f).q();4($.N.L)e.3.L();e.m=$(\'10\',e.3);e.f=$(\'t.f\',e.3);e.o=$(\'t.o\',e.3)}8 7(a){g $.1j(a,"k")}8 1f(a){4(7(2).Z)B=26(l,7(2).Z);p l();M=!!7(2).M;$(K.f).23(\'W\',u);u(a)}8 1e(){4($.k.w||2==9||(!2.13&&!7(2).U))g;9=2;m=2.13;4(7(2).U){e.m.q();j a=7(2).U.1Z(2);4(a.1Y||a.1V){e.f.1c().T(a)}p{e.f.D(a)}e.f.l()}p 4(7(2).18){j b=m.1T(7(2).18);e.m.D(b.1R()).l();e.f.1c();1Q(j i=0,R;(R=b[i]);i++){4(i>0)e.f.T("<1P/>");e.f.T(R)}e.f.1x()}p{e.m.D(m).l();e.f.q()}4(7(2).1d&&$(2).o())e.o.D($(2).o().1O(\'1N://\',\'\')).l();p e.o.q();e.3.P(7(2).X);4(7(2).H)e.3.H();1f.1L(2,1K)}8 l(){B=S;4((!A||!$.N.L)&&7(9).r){4(e.3.I(":17"))e.3.Q().l().O(7(9).r,9.11);p e.3.I(\':1a\')?e.3.O(7(9).r,9.11):e.3.1G(7(9).r)}p{e.3.l()}u()}8 u(c){4($.k.w)g;4(c&&c.1W.1X=="1E"){g}4(!M&&e.3.I(":1a")){$(K.f).1b(\'W\',u)}4(9==S){$(K.f).1b(\'W\',u);g}e.3.V("z-14").V("z-1A");j b=e.3[0].1z;j a=e.3[0].1y;4(c){b=c.2o+7(9).E;a=c.2n+7(9).G;j d=\'1w\';4(7(9).2k){d=$(C).1r()-b;b=\'1w\'}e.3.n({E:b,14:d,G:a})}j v=z(),h=e.3[0];4(v.x+v.1s<h.1z+h.1n){b-=h.1n+20+7(9).E;e.3.n({E:b+\'1C\'}).P("z-14")}4(v.y+v.1t<h.1y+h.1m){a-=h.1m+20+7(9).G;e.3.n({G:a+\'1C\'}).P("z-1A")}}8 z(){g{x:$(C).2e(),y:$(C).2d(),1s:$(C).1r(),1t:$(C).2p()}}8 q(a){4($.k.w)g;4(B)2c(B);9=S;j b=7(2);8 J(){e.3.V(b.X).q().n("1g","")}4((!A||!$.N.L)&&b.r){4(e.3.I(\':17\'))e.3.Q().O(b.r,0,J);p e.3.Q().2b(b.r,J)}p J();4(7(2).H)e.3.1l()}})(2a);',62,155,'||this|parent|if|||settings|function|current||||||body|return|||var|tooltip|show|title|css|url|else|hide|fade||div|update||blocked|||viewport|IE|tID|window|html|left|each|top|fixPNG|is|complete|document|bgiframe|track|fn|fadeTo|addClass|stop|part|null|append|bodyHandler|removeClass|mousemove|extraClass|backgroundImage|delay|h3|tOpacity|false|tooltipText|right||id|animated|showBody|true|visible|unbind|empty|showURL|save|handle|opacity|defaults|class|data|attr|unfixPNG|offsetHeight|offsetWidth|position|src|createHelper|width|cx|cy|relative|extend|auto|hideWhenEmpty|offsetTop|offsetLeft|bottom|filter|px|none|OPTION|RegExp|fadeIn|navigator|png|match|arguments|apply|test|http|replace|br|for|shift|click|split|mouseout|jquery|target|tagName|nodeType|call||mouseover|alt|bind|removeAttr|200|setTimeout|appendTo|href|MSIE|jQuery|fadeOut|clearTimeout|scrollTop|scrollLeft|absolute|msie|crop|sizingMethod|enabled|positionLeft|AlphaImageLoader|Microsoft|pageY|pageX|height|DXImageTransform|progid|block|userAgent|browser'.split('|'),0,{}))
