Tooltips for HTML links

Reply

Join Date: Apr 2006
Posts: 5
Reputation: madhav_2k is an unknown quantity at this point 
Solved Threads: 0
madhav_2k madhav_2k is offline Offline
Newbie Poster

Tooltips for HTML links

 
0
  #1
Feb 22nd, 2007
i'm fascinated by the tooltip or the information bubble , which pops-up on this page when I point my cursor on a thread title.
Does anyone know what it takes to code something like that? Is it possible with PHP, javascript or AJAX ?

The attached image shows the tooltip I'm referring to!
Attached Thumbnails
tt.JPG  
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Tooltips for HTML links

 
0
  #2
Feb 22nd, 2007
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1
Reputation: dvsgr is an unknown quantity at this point 
Solved Threads: 0
dvsgr dvsgr is offline Offline
Newbie Poster

Re: Tooltips for HTML links

 
0
  #3
Feb 18th, 2008
Hi there,
I read your post about that cool imagetooltip.

Well here is the thing. I have tried it in php page with a static page but what about when you want dynamic content in the tool tip. I mean what If i have 40 products with their images and I want to show them accordingly.

here is some code I tried but it didnt worked.

  1. mysql_data_seek($result, $i);
  2.  
  3. $newArray = mysql_fetch_assoc($result);
  4.  
  5. $aa = $newArray['aa'];
  6.  
  7. $Model = $newArray['Model'];
  8.  
  9.  
  10. echo "messages[".$aa."] = new Array('".$Model.".pdf','',\"#FFFFFF\");\n";

and then in the actualy product list

  1. echo " <td align=\"center\" bgcolor=\"#F2F5F7\"><A href=\"javascript:void(window.open('pdf/".$Model.".pdf', '', 'resizable=no,scrollbars=yes,status=yes,width=620,height=750'))\" onmouseover=\"doTooltip(event,".$aa.")\" onmouseout=\"hideTip()\" class=\"style17\">$Model</A></td>\n";

It did worked with one image (always the same but I would like to have a piicture for each different porduct. I have uploaded all products images on server as I did for pdfs.
Thanks in advance

Fotis
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: Tooltips for HTML links

 
0
  #4
Feb 19th, 2008
The way that I personally would be doing this is
setting a "while" statement as my query result which would include what is in your "echo", and then echoing the result in the html body itself.

The while statement itself means that you don't really have to deal with creating and manipulating arrays "by hand" as I like to say. it parses it on it's own, simply by making your final result something like

  1. $myresult .= "<td align=\"center\" bgcolor=\"#F2F5F7\"><A href=\"javascript:void(window.open('pdf/".$Model.".pdf', '', 'resizable=no,scrollbars=yes,status=yes,width=620,height=750'))\" onmouseover=\"doTooltip(event,".$aa.")\" onmouseout=\"hideTip()\" class=\"style17\">$Model</A></td>\n";

And then, in your html body
  1. echo $myresult;

The dot before the = is required to make it loop itself (I think).
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 9
Reputation: squid44th is an unknown quantity at this point 
Solved Threads: 0
squid44th's Avatar
squid44th squid44th is offline Offline
Newbie Poster

Re: Tooltips for HTML links

 
0
  #5
Feb 22nd, 2008
I prefer to use the css version of the tool tip.

  1. <style type="text/css">
  2. #info p {margin-left:15px; margin-right:20px;}
  3. #info img {margin:15px; float:left;}
  4. #info h1 {margin-left:15px;}
  5. /* the style starts here */
  6. a.tooltip {color:#c00;}
  7. a.tooltip b {display:none;}
  8. a.tooltip:hover {border:0; position:relative; z-index:500; text-decoration:none;}
  9. a.tooltip:hover b {display:block; position:absolute; top:20px; left:-25px; padding:5px; font-weight:normal; color:#000; border:1px solid #888; background:#ffc; width:150px;}
  10. a.tooltip:hover b em {position:absolute; left:20px; top:-6px; width:11px; height:6px; background:#fff url(tooltip.gif) 0 0; display:block; font-size:1px;}
  11. </style>
  1. <a class="tooltip" href="link or anchor">Display<b><em></em>The text in tool tip</a>

found it at CSS Play
Attached Thumbnails
css-tooltip.jpg  
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2424 | Replies: 4
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC