About AmeriCommerce
 Getting Started and Initial Setup
 Site Design and Layout
  Catalog and Product Management
 General Topics
 Images and Product Photos
 Content Management
 Email Management
 External Carting
 Marketing Management
 Microstores and Multiple Storefronts
 Order Management
 Payments Setup and Management
 Reporting and Analytics
 Security Management
 Shipping
  Other Software and Services
 AmeriCommerce API
 AmeriSync for Quickbooks
  Other Help and Docs
 Screenshots
 Training Videos
 Release History
 Glossary of Terms
Question / Issue - KB ID # 128

Adding a custom JavaScript 'ToolTip' to your site


Answer / Solution
Last Update : 2008/08/19
Rating : Not Rated
Send FAQ by E-mail
Add to favorites
Print this FAQ

Social Bookmark this Article :

The code provided here will enable you to add a custom 'ToolTip' message that appears when visitors move their mouse over an element of your website. It can display anything such as a basic line of text, several paragraphs, or an image. It can also include dynamic information from AmeriCommerce merge codes.

In the Theme Designer for your current theme, go to the Page Header page, and paste this code into the Javascript section. (It is displayed here as an image due to limitations in the FAQ software; please download the attached file tooltips-code.txt instead.)

Next, go to the Layout Settings page, and paste this code into the Custom CSS section:

.tooltip 
{
    visibility: hidden;
    position: absolute;
    top: 0; 
    left: 0;
    z-index: 2;
    width: 200px;
    font: normal 8pt sans-serif;
    color: #2B7198;
    padding: 4px;
    border: 1px solid #2091BC;
    background-color: #EFEFEF;
}

The formatting codes in the lower half (font, color, border, background-color) can be customized if desired, to make the tooltip boxes coordinate with your site's appearance. The width can also be changed if you want the boxes to be wider or thinner, or the whole width line can be removed if you want the boxes to adjust their sizes automatically.

Then, go to the theme settings for a page on which you want to use a tooltip (for example, Product Details). In the Custom Page Design area (in HTML Code mode), add a Div with a class of "tooltip" and a unique ID. This div can include HTML. For example:

The div can also include content from AmeriCommerce merge codes. For example:

Finally, connect the tooltip to an element on that page. This could be an image, a link, a list item, or anything else. Give the element a unique ID, and add these two attributes:

onmouseover="tooltip_show('tooltip_deliveryfee',event);" onmouseout="tooltip_hide('tooltip_deliveryfee');" 

(replacing both uses of tooltip_deliveryfee with the ID of the desired tooltip div). For example:

 

Your tooltip should now be ready to use. Here is an example of these tooltips in use on an AmeriCommerce client's website:

 


Attachments
tooltips-code.txt (0.6Kb)

Related FAQs
HOWTO: Change the design or layout of the Product Details page?
What Merge Codes are available?
Listing of all available site merges

Direct Link to This FAQ
https://www.americommerce.com/kb/?f=128

Tags

How would you rate this article?

Poor
1
2
3
4
5

Great
Submit

Back to Top