X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=wicket%2Fcomponents%2Fsrc%2Fmain%2Fresources%2Forg%2Fwamblee%2Fwicket%2Fbehavior%2Fwamblee-tooltip.js;h=3bdd99d13b218d1469cbc25922ba32cc855bb5f8;hb=HEAD;hp=7773cb4ad4bb5c829684066b2981a9aa7bf4484f;hpb=6c5dc665abfe021a7add911d1ca167113f4ccae8;p=utils diff --git a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-tooltip.js b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-tooltip.js index 7773cb4a..3bdd99d1 100644 --- a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-tooltip.js +++ b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-tooltip.js @@ -25,8 +25,8 @@ var options = $.extend({ delay : 500, - fadein : 500, - fadeout: 200, + fadein : 250, + fadeout: 100, border : "1px solid black", padding : "0.2em 0.5em 0.2em 0.5em", background : "yellow" @@ -34,6 +34,9 @@ // Show the tooltip. var tooltipShow = function(event) { + timerid = setTimeout(function() { + content.fadeIn(options.fadein); + }, options.delay); var content = $("#tooltipContent").text(text).css({ position : "absolute", top : event.pageY + 5, @@ -42,21 +45,17 @@ padding : options.padding, background : options.background }); - timerid = setTimeout(function() { - content.fadeIn(options.fadein); - }, options.delay); - // console.log("start"); }; // Hide the tooltip. var tooltipHide = function(event) { - $("#tooltipContent").fadeOut(options.fadeout); if (timerid) { console.log("clear timeout"); clearTimeout(timerid); timerid = undefined; } + $("#tooltipContent").fadeOut(options.fadeout); } // Add hover listeners.