Jump to content

Tooltip


RobertP

Recommended Posts

Not sure if this is a javascript or a css problem.

 

but when hovering on my tr's in my list, there is padding or something added to the table that makes it jump a little.

 

example: http://bend.gludoe.com/

 

caused by the tooltip i presume.

 

css

div#tooltip{
position:absolute;
z-index:9999;
color:#FFF;
font-size:10px;
width:180px;
background-color:#000;
padding:8px 12px;
border-radius:8px;
}

 

js

$(".tooltip").live("mouseover",function(e){
tip = $(this).attr("title");
if(!tip)
	return;
$(this).attr("title","");
$(this).append("<div id=\"tooltip\">"+tip+"</div>");
}).mousemove(function(e){
$("#tooltip").css("top",e.pageY+10);
$("#tooltip").css("left",e.pageX+20);
}).mouseout(function(){
$(this).attr("title",$("#tooltip").html());
$(this).children("div#tooltip").remove();
});

 

if you can help, i am completely stumped on this :S

Link to comment
Share on other sites

solved

 

js

	$(".tooltip").live("mouseover",function(e){
	tip = $(this).attr("title");
	if(!tip)
		return;
	$(this).attr("title","");
	$("body").append("<div id=\"tooltip\">"+tip+"</div>");
}).mousemove(function(e){
	$("#tooltip").css("top",e.pageY+10);
	$("#tooltip").css("left",e.pageX+20);
}).mouseout(function(){
	$(this).attr("title",$("#tooltip").html());
	$("div#tooltip").remove();
});

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.