You are here:  » Mouse over tooltips

Support Forum



Mouse over tooltips

Submitted by Al on Thu, 2008-08-14 10:41 in

When the search results are presented, the shop logo is visible. Also of course a list with shops which sell the same product. When the user's mouse is over a shop logo, I want to pop up an .jpg image.
I have found a javascript tool to support this action.

The script is placed into the header (corrtect me if I am wrong, this will be header.php)

But where do I put the following:

"Step 2: Then, set up your links to contain the necessary onMouseover and out attributes. Use the following code as an example, where 0 and 1 refer to the image tooltip's index number in the script above that you wish to invoke :"

<a href="#" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">Link 1</a><br>
<a href="#" onmouseover="doTooltip(event,1)" onmouseout="hideTip()">Link 2</a>

I already have a prices.php:

<div class='prices'>
  <table width='100%' cellpadding='4'>
    <tr bgcolor='#eeeeee'>
      <th width='200' align='left'><?php print translate("Stockist"); ?></th>
      <th>&nbsp;</th> <!-- blank column for merchant logo -->
      <th align='left'><?php print translate("Catalogue Product Name"); ?></th>
      <th align='left'><?php print translate("Price"); ?></th>
      <th align='left'>&nbsp;</th>
    </tr>
    <?php foreach($prices["products"] as $product): ?>
    <tr bgcolor='#ffffcc'>
      <td><a href='<?php print $product["merchantHREF"]; ?>'><?php print $product["merchant"]; ?></a></td>
      <td>
      <?php
      if (file_exists("logos/".$product["merchant"]))
      {
        print "<a href='".tapestry_buyURL($product)."'><img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' alt='".$product["name"]."' /></a>";
      }
      else
      {
        print "&nbsp;";
      }
      ?>
      </td>
      <td><?php print $product["name"]; ?></td>
      <td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong></td>
      <td align='center'><a href='<?php print tapestry_buyURL($product); ?>' <?php print javascript_statusBar("go to ".$product["merchant"]); ?>><?php print translate("Visit Store"); ?></a></td>
    </tr>
    <?php endforeach; ?>
  </table>
</div>

Can you help me to implement this "step 2 code" into the code above?

Submitted by support on Thu, 2008-08-14 11:54

Hi Al,

That should just be a case of changing this line:

print "<a href='".tapestry_buyURL($product)."'><img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' alt='".$product["name"]."' /></a>";

...to:

print "<a href='".tapestry_buyURL($product)."' onmouseover='doTooltip(event,0)' onmouseout='hideTip()'><img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' alt='".$product["name"]."' /></a>";

I've changed the " to ' as that is a PHP section where " is the string delimiter, but that shouldn't make any difference...

Cheers,
David.