",tipClass:"tooltip"},addEffect:function(t,o,n){e[t]=[o,n]}};var e={toggle:[function(t){var e=this.getConf(),o=this.getTip(),n=e.opacity;n<1&&o.css({opacity:n}),o.show(),t.call()},function(t){this.getTip().hide(),t.call()}],fade:[function(t){var e=this.getConf();this.getTip().fadeTo(e.fadeInSpeed,e.opacity,t)},function(t){var e=this.getConf();this.getTip().fadeOut(e.fadeOutSpeed,t)}]};function o(e,o,n){var i=n.relative?e.position().top:e.offset().top,s=n.relative?e.position().left:e.offset().left,r=n.position[0];i-=o.outerHeight()-n.offset[0],s+=e.outerWidth()+n.offset[1],/iPad/i.test(navigator.userAgent)&&(i-=t(window).scrollTop());var a=o.outerHeight()+e.outerHeight();"center"===r&&(i+=a/2),"bottom"===r&&(i+=a),r=n.position[1];var l=o.outerWidth()+e.outerWidth();return"center"===r&&(s-=l/2),"left"===r&&(s-=l),{top:i,left:s}}function n(n,i){var s,r,a=this,l=n.add(a),c=0,f=0,u=n.attr("title"),d=n.attr("data-tooltip"),h=e[i.effect],p=n.is(":input"),g=p&&n.is(":checkbox, :radio, select, :button, :submit"),v=n.attr("type"),w=i.events[v]||i.events[p?g?"widget":"input":"def"];if(!h)throw'Nonexistent effect "'+i.effect+'"';if(2!=(w=w.split(/,\s*/)).length)throw"Tooltip: bad events configuration for "+v;n.on(w[0],(function(t){clearTimeout(c),i.predelay?f=setTimeout((function(){a.show(t)}),i.predelay):a.show(t)})).on(w[1],(function(t){clearTimeout(f),i.delay?c=setTimeout((function(){a.hide(t)}),i.delay):a.hide(t)})),u&&i.cancelDefault&&(n.removeAttr("title"),n.data("title",u)),t.extend(a,{show:function(e){if(!s&&(d?s=t(d):i.tip?s=t(i.tip).eq(0):u?s=t(i.layout).addClass(i.tipClass).appendTo(document.body).hide().append(u):(s=n.next()).length||(s=n.parent().next()),!s.length))throw"Cannot find tooltip for "+n;if(a.isShown())return a;s.stop(!0,!0);var p=o(n,s,i);if(i.tip&&s.html(n.data("title")),(e=t.Event()).type="onBeforeShow",l.trigger(e,[p]),e.isDefaultPrevented())return a;p=o(n,s,i),s.css({position:"absolute",top:p.top,left:p.left}),r=!0,h[0].call(a,(function(){e.type="onShow",r="full",l.trigger(e)}));var g=i.events.tooltip.split(/,\s*/);return s.data("__set")||(s.off(g[0]).on(g[0],(function(){clearTimeout(c),clearTimeout(f)})),g[1]&&!n.is("input:not(:checkbox, :radio), textarea")&&s.off(g[1]).on(g[1],(function(t){t.relatedTarget!=n[0]&&n.trigger(w[1].split(" ")[0])})),i.tip||s.data("__set",!0)),a},hide:function(o){return s&&a.isShown()?((o=t.Event()).type="onBeforeHide",l.trigger(o),o.isDefaultPrevented()?void 0:(r=!1,e[i.effect][1].call(a,(function(){o.type="onHide",l.trigger(o)})),a)):a},isShown:function(t){return t?"full"===r:r},getConf:function(){return i},getTip:function(){return s},getTrigger:function(){return n}}),t.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),(function(e,o){"function"==typeof i[o]&&t(a).on(o,i[o]),a[o]=function(e){return e&&t(a).on(o,e),a}}))}t.fn.tooltip=function(e){var o=this.data("tooltip");return o||("string"==typeof(e=t.extend(!0,{},t.tools.tooltip.conf,e)).position&&(e.position=e.position.split(/,?\s/)),this.each((function(){o=new n(t(this),e),t(this).data("tooltip",o)})),e.api?o:this)}}(jQuery),function(t){var e=t.tools.tooltip;e.dynamic={conf:{classNames:"top right bottom left"}},t.fn.dynamic=function(o){"number"==typeof o&&(o={speed:o}),o=t.extend({},e.dynamic.conf,o);var n,i=t.extend(!0,{},o),s=o.classNames.split(/\s/);return this.each((function(){var e=t(this).tooltip().onBeforeShow((function(e,o){var r=this.getTip(),a=this.getConf();n||(n=[a.position[0],a.position[1],a.offset[0],a.offset[1],t.extend({},a)]),t.extend(a,n[4]),a.position=[n[0],n[1]],a.offset=[n[2],n[3]],r.css({visibility:"hidden",position:"absolute",top:o.top,left:o.left}).show();var l=t.extend(!0,{},i),c=function(e){var o=t(window),n=o.width()+o.scrollLeft(),i=o.height()+o.scrollTop();return[e.offset().top<=o.scrollTop(),n<=e.offset().left+e.width(),i<=e.offset().top+e.height(),o.scrollLeft()>=e.offset().left]}(r);(function(t){for(var e=t.length;e--;)if(t[e])return!1;return!0})(c)||(c[2]&&(t.extend(a,l.top),a.position[0]="top",r.addClass(s[0])),c[3]&&(t.extend(a,l.right),a.position[1]="right",r.addClass(s[1])),c[0]&&(t.extend(a,l.bottom),a.position[0]="bottom",r.addClass(s[2])),c[1]&&(t.extend(a,l.left),a.position[1]="left",r.addClass(s[3])),(c[0]||c[2])&&(a.offset[0]*=-1),(c[1]||c[3])&&(a.offset[1]*=-1)),r.css({visibility:"visible"}).hide()}));e.onBeforeShow((function(){var t=this.getConf();this.getTip();setTimeout((function(){t.position=[n[0],n[1]],t.offset=[n[2],n[3]]}),0)})),e.onHide((function(){this.getTip().removeClass(o.classNames)})),ret=e})),o.api?ret:this}}(jQuery),function(t){var e=t.tools.tooltip;t.extend(e.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!0});var o={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};e.addEffect("slide",(function(t){var e=this.getConf(),n=this.getTip(),i=e.slideFade?{opacity:e.opacity}:{},s=o[e.direction]||o.up;i[s[1]]=s[0]+"="+e.slideOffset,e.slideFade&&n.css({opacity:0}),n.show().animate(i,e.slideInSpeed,t)}),(function(e){var n=this.getConf(),i=n.slideOffset,s=n.slideFade?{opacity:0}:{},r=o[n.direction]||o.up,a=""+r[0];n.bounce&&(a="+"===a?"-":"+"),s[r[1]]=a+"="+i,this.getTip().animate(s,n.slideOutSpeed,(function(){t(this).hide(),e.call()}))}))}(jQuery);
'}}})();
タイトルとURLをコピーしました