// ÅøÆÁ // use pageXY(), clientXY() (function($) { $(window).bind('resize', function() { var bodyWH = bodySize(); bodyWidthHalf = bodyWH.width / 2; bodyHeightHalf = bodyWH.height / 2; }).trigger('resize'); var tipDiv$ = $("
").css({ "text-align":"left", "padding":"5px", "border":"1px solid dimgray", "position":"absolute", "background-color":"ivory", "font":"9pt µ¸¿ò", "color":"#444444", "z-index":"3000" }); $.fn.tip = function() { this.find("*[tip]") .bind("mouseover", function(event){ tipDiv$.html($(this).attr("tip")).appendTo(document.body).show().trigger('mousemove'); //if (tipDiv$.height() > 196) tipDiv$.height(196).css("overflow", "hidden"); }) .bind("mouseout", function() { tipDiv$.hide();//tipDiv$.css({"height":"13px", "overflow":"visible"}).hide(); }) .bind("mousemove", function(event){ var xy = pageXY(event); var cl = clientXY(event); var x = bodyWidthHalf < cl.x ? xy.x - $("#tipDiv").width() - 10 : xy.x + 20; var y = bodyHeightHalf < cl.y ? xy.y - $("#tipDiv").height() - 10 : xy.y + 10; if (bodyWidthHalf < cl.x) x -= 20; tipDiv$.css("left", x).css("top", y); }); } })(jQuery);