html - Jquery ToolTip - working but needs tweaking -
i'm using code here : http://cssglobe.com/easiest-tooltip-and-image-preview-using-jquery/
this seems work fine apart issue table.
my table wide, has on 80 columns , requires me scroll see all. that's fine because of layout works scrolling.
each header has tooltip assigned gives details on column below. again works 1 exception.
the tooltips starts wrap near right hand edge of page, header / tooltip of screen , requires scrolling wrapped.
is there anyway fixed width on tooltip regardless of appears on page in relation right edge ?
this jquery :
/* * tooltip script * powered jquery (http://www.jquery.com) * * written alen grakalic (http://cssglobe.com) * * more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery * */ this.tooltip = function(){ /* config */ xoffset = 10; yoffset = 20; // these 2 variable determine popup's distance cursor // might want adjust right result /* end config */ $("a.tooltip").hover(function(e){ this.t = this.title; this.title = ""; $("body").append("<p id='tooltip'>"+ this.t +"</p>"); $("#tooltip") .css("top",(e.pagey - xoffset) + "px") .css("left",(e.pagex + yoffset) + "px") .fadein("fast"); }, function(){ this.title = this.t; $("#tooltip").remove(); }); $("a.tooltip").mousemove(function(e){ $("#tooltip") .css("top",(e.pagey - xoffset) + "px") .css("left",(e.pagex + yoffset) + "px"); }); }; // starting script on page load $(document).ready(function(){ tooltip(); });
it called using :
<a href="http://cssglobe.com" class="tooltip" title="web standards magazine">roll on tooltip</a>
and styled using :
#tooltip{ position:absolute; border:1px solid #333; background:#f7f5d1; padding:2px 5px; color:#333; display:none; }
adding width:150 !important; works, when right of page tooltip disappears off page.
any way make display right left when gets right hand edge ?
Comments
Post a Comment