Tutorials & Script Homepage
HTML/DHTML 1to7
HTML - Lists
Using iFrames
Background Colours
Basic Tables
Advanced Tables
Tables Tricks 'n' Tips
Tip Boxes
 
HTML/DHTML TUTORIAL NUMBER : 07
Please Click Here, and Help Keep This Site FREE to Use
 
Please click on our sponsors advert to the right if you download or use anything from this page.
Thank you for your help.
This tutorial has been created by: Smartwebby.com

Tip Boxes

When writing content for your site you might want to give some tips or explainations for particular words or phrases. For this you might consider using DHTML Tip boxes that appear when a link is rolled over. The following example shows how you can do this.

Example of a link Tip Box

Rollover the link to see the Tip Box


Cut 'n' paste code for the above Example
Java-script Code

HTML Code


Instructions

Make a transparent gif called shim under your images folder as 'div' tag layers need an image to be present to work in Netscape plus we need it as a place holder (usually following the link) to show where the tip box should appear. If you are trying to use multiple tip boxes then you need to change the name of the respective div layer id field and also change the reference to it in the link onMouseOver event for the respective boxes. Also give the image place holder (here the shim image named imgDel) a new name property for each tip box and change the reference to it in the link onMouseOver event for the respective boxes.


Explanation of the Code

The java-script has the following main functions:

  • function showTipBox is used to make the tip box appear : This function first finds the top and left position of the place holder shim image (usually placed following the link) by its name passed to it while calling the function in the link onMouseOver event. Next it shows the div tag layer by the layer name passed to it by setting its visiblity property (to 'show' in Netscape and 'visible' in IE) and places it in the position of the place holder image.

  • function linkTimer is called to hide the tip box on the onMouseOut event after a small pause : This function waits for a small time period (here 500 milliseconds i.e. 1/2 a second) and then calls the hideLayer function (it passes the visible layer name).

  • function hideLayer is used to hide the visible tip box by setting the visibility property of the layer to 'hide' in Netscape and 'hidden' in IE.

I hope this came in useful!
Ask in the forum if you have any suggestions or comments.

Web Hosting  |  Membership website templates  |  Reliable UK Web Hosting  |  Dallas Web Design  |  Art Web Templates  |  Cheap Flight Deals  |  Free Web Hosting  |  Digital Camera  |  Coursework Writing  |  Reseller Hosting  |  Directory Submission Service  |  Cheap UK Web Hosting  |   Youth hostels  |  Web Design  |  Low Cost Domain Names  |  Windows Hosting ASP.NET  |  Website templates  |  Broadband Reseller  |  Dedicated Server  |  Business Broadband  |  Professionelt webdesign firma - webbureau  |  Austin Web Design  |  Flash Templates  |   SEO Services India  |  Flash Intros  |  Web Templates  |  Cheap Web Hosting  |  Hyper-V Hosting  |  Website Templates  |  Corporate Logo Design Service  |  SEO  |  UK Dedicated Server Hosting  |  Best Web hosting  |  Bespoke Software Development  |   Free Web Hosting  |  UK Web Hosting  |  Dating Software - aeDating 4.1  |  Flash Templates  |  Website Templates  |  Power Saver  |  Website Design Quote  |  Flash templates  |  cctv cameras  |  SEO  |  Web Templates  |  Web Design uk  |   Flash templates  |  Cheap Web Hosting Deal  |  Linux Hosting  |  Web Design uk  |  Web Hosting  |  Business web directory  |  Accept Credit Cards  |  Mobile Phone Contracts  |  Car Rental Deals  |  Free domain names  |  Business Email  |  Best UK web Hosting  |