| | |
Tooltips for HTML links
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2008
Posts: 1
Reputation:
Solved Threads: 0
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.
and then in the actualy product list
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
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.
PHP Syntax (Toggle Plain Text)
mysql_data_seek($result, $i); $newArray = mysql_fetch_assoc($result); $aa = $newArray['aa']; $Model = $newArray['Model']; echo "messages[".$aa."] = new Array('".$Model.".pdf','',\"#FFFFFF\");\n";
and then in the actualy product list
PHP Syntax (Toggle Plain Text)
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
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Solved Threads: 6
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
And then, in your html body
The dot before the = is required to make it loop itself (I think).
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
PHP Syntax (Toggle Plain Text)
$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
PHP Syntax (Toggle Plain Text)
echo $myresult;
The dot before the = is required to make it loop itself (I think).
I prefer to use the css version of the tool tip.
found it at CSS Play
PHP Syntax (Toggle Plain Text)
<style type="text/css"> #info p {margin-left:15px; margin-right:20px;} #info img {margin:15px; float:left;} #info h1 {margin-left:15px;} /* the style starts here */ a.tooltip {color:#c00;} a.tooltip b {display:none;} a.tooltip:hover {border:0; position:relative; z-index:500; text-decoration:none;} 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;} 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;} </style>
PHP Syntax (Toggle Plain Text)
<a class="tooltip" href="link or anchor">Display<b><em></em>The text in tool tip</a>
found it at CSS Play
![]() |
Similar Threads
- Javascript links never work in IE6 (Web Browsers)
- index.html AND home.html WHY? (HTML and CSS)
- HTML-CSS trouble (HTML and CSS)
- Passing values from server-side code to html (ASP.NET)
- This is an html problem (HTML and CSS)
- Help needed for hijacker with homepage address location of C:\WINDOWS\secure.html (Viruses, Spyware and other Nasties)
- Active/Inactive HTML Links in Web Application (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: Which one is the Best PHP editor
- Next Thread: PHP / SQL Delete From Statement Not working with URL?
Views: 2424 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube






