File "jquery.tooltip.min.js"

Full path: /home/kosmetik/public_html/wp-content/plugins/shortpixel-image-optimiser/res/js/jquery.tooltip.min.js
File size: 3.45 B
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

!function(t){t.fn.spTooltip=function(o){t.fn.spTooltip.defaultsSettings={attributeName:"title",borderColor:"#ccc",borderSize:"1",cancelClick:0,followMouse:1,height:"auto",hoverIntent:{sensitivity:7,interval:100,timeout:0},loader:0,loaderHeight:0,loaderImagePath:"",loaderWidth:0,positionTop:12,positionLeft:12,width:"auto",titleAttributeContent:"",tooltipBGColor:"#fff",tooltipBGImage:"none",tooltipHTTPType:"get",tooltipPadding:10,tooltipSource:"attribute",tooltipSourceID:"",tooltipSourceURL:"",tooltipID:"tooltip"};var e=t.extend({},t.fn.spTooltip.defaultsSettings,o||{}),i=function(o){o.preventDefault();var i=0,n=0;if(!o)o=window.event;o.pageX||o.pageY?(i=o.pageX,n=o.pageY):(o.clientX||o.clientY)&&(i=o.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=o.clientY+document.body.scrollTop+document.documentElement.scrollTop);var l={x:i+e.positionLeft,y:n+e.positionTop,w:t("#"+e.tooltipID).width(),h:t("#"+e.tooltipID).height()},r={x:t(window).scrollLeft(),y:t(window).scrollTop(),w:t(window).width()-20,h:t(window).height()-20};l.y+l.h>r.y+r.h&&l.x+l.w>r.x+r.w?(l.x=l.x-l.w-45,l.y=l.y-l.h-45):l.x+l.w>r.x+r.w?l.x=l.x-(l.x+l.w-(r.x+r.w)+20):l.y+l.h>r.y+r.h&&(l.y=l.y-(l.y+l.h-(r.y+r.h)+20)),t("#"+e.tooltipID).css({left:l.x+"px",top:l.y+"px"})},n=function(){t("#tooltipLoader").remove(),t("#"+e.tooltipID+" #tooltipContent").show()},l=function(o){t("#"+e.tooltipID).fadeOut("fast").trigger("unload").remove(),t(o).filter("[title]")&&t(o).attr("title",e.titleAttributeContent)},r=function(t){var o={};return t.replace(/b([^&=]*)=([^&=]*)b/g,function(t,e,i){void 0!==o[e]?o[e]+=","+i:o[e]=i}),o};return this.each(function(o){function p(o){t("body").append('<div id="'+e.tooltipID+'" style="background-repeat:no-repeat;background-image:url('+e.tooltipBGImage+");padding:"+e.tooltipPadding+"px;display:none;height:"+e.height+";width:"+e.width+";background-color:"+e.tooltipBGColor+";border:"+e.borderSize+"px solid "+e.borderColor+'; position:absolute;z-index:100000000000;"><div id="tooltipContent" style="display:none;"></div></div>');var p=t("#"+e.tooltipID),a=t("#"+e.tooltipID+" #tooltipContent");switch(e.loader&&""!=e.loaderImagePath&&p.append('<div id="tooltipLoader" style="width:'+e.loaderWidth+"px;height:"+e.loaderHeight+'px;"><img src="'+e.loaderImagePath+'" /></div>'),t(this).attr("title")&&(e.titleAttributeContent=t(this).attr("title"),t(this).attr("title","")),t(this).is("input")&&t(this).focus(function(){l(this)}),o.preventDefault(),i(o),p.show(),e.tooltipSourceID=t(this).attr("href")||e.tooltipSourceID,e.tooltipSourceURL=t(this).attr("href")||e.tooltipSourceURL,e.tooltipSource){case"attribute":a.text(e.titleAttributeContent),n();break;case"inline":a.html(t(e.tooltipSourceID).children()),p.unload(function(){t(e.tooltipSourceID).html(a.children())}),n();break;case"ajax":if("post"==e.tooltipHTTPType){var d,u;-1!==e.tooltipSourceURL.indexOf("?")?(d=e.windowSourceURL.substr(0,e.windowSourceURL.indexOf("?")),u=r(e.tooltipSourceURL)):(d=e.tooltipSourceURL,u={}),a.load(d,u,function(){n()})}else-1==e.tooltipSourceURL.indexOf("?")&&(e.tooltipSourceURL+="?"),a.load(e.tooltipSourceURL+"&random="+(new Date).getTime(),function(){n()})}return!1}function a(t){return l(this),!1}e.cancelClick&&t(this).bind("click",function(){return!1}),t.fn.hoverIntent?t(this).hoverIntent({sensitivity:e.hoverIntent.sensitivity,interval:e.hoverIntent.interval,over:p,timeout:e.hoverIntent.timeout,out:a}):t(this).hover(p,a),e.followMouse&&t(this).bind("mousemove",function(t){return i(t),!1})})}}(jQuery);