In this article, I'll provide you with easy code to highlight keywords and create a specific popup menu for each keyword. We'll apply some simple CSS (Cascading Style Sheets) rules to control the appearance of the popup menus. We'll use three very simple Java Script functions to control the whole thing.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

[About BTH]  [User Agreement]  [Privacy Policy]  [Site Map]  [Contact Form]  [Advertise on BTH]  [News Feed]

Google
Web
This Site

Add More Bang to Your Content With Keyword Popup Menus

In today's competitive environment you need all the bang you can get from the content of your Web site. You can expand the text on your webpage by making specific keywords into text links. If the user clicks on a text link, it will take them to another page on your Website, or an advertisement on your website, or perform a search related to that keyword. What if, when the user moved their mouse pointer over a keyword, a popup menu appeared providing links for all three of those options?

In this article, I'll provide you with easy code to do just that. We'll use html span elements to highlight keywords and create a specific popup menu for each keyword. We'll apply some simple CSS (Cascading Style Sheets) rules to control the appearance of the popup menus. We'll use three very simple Java Script functions to control the whole thing. You'll be surprised how easy it is to use this technique add more bang to your webpage content.

Below is an example of some informative content you might find on a typical website.

There are basically two different types of printers in
use by the home consumer today. The inkjet printer or
bubble jet printer squirts tiny droplets of ink on the
surface of the paper to form an image. The laser type
of printer uses toner powder with a photo electrostatic
process to form an image on paper. Replacement ink
cartridges cost much less than replacement toner
cartridges, but the cost per printed page is much
higher for inkjet printing than laser printing.

We can get more bang from this content by linking the keywords "inkjet printer","bubble jet printer", "ink cartridges", and "toner cartridges" to webpages that give more information, sell printers and cartridges, and generate (possibly paid) searches for these items. The four html span elements shown below create popup menus related to these four keywords.

<span id="menu1" class="popMenu">
<a href="#" class="menuLink">Definition</a>
<a href="#" class="menuLink">Buy inkjet printer</a>
<a href="#" class="menuLink">Search inkjet printer</a>
</span>

<span id="menu2" class="popMenu">
<a href="#" class="menuLink">Definition</a>
<a href="#" class="menuLink">Buy laser printer</a>
<a href="#" class="menuLink">Search laser printer</a>
</span>

<span id="menu3" class="popMenu">
<a href="#" class="menuLink">Definition</a>
<a href="#" class="menuLink">Buy ink cartridge</a>
<a href="#" class="menuLink">Search ink cartridge</a>
</span>

<span id="menu4" class="popMenu">
<a href="#" class="menuLink">Definition</a>
<a href="#" class="menuLink">Buy toner cartridge</a>
<a href="#" class="menuLink">Search toner cartridge</a>
</span>

You can place these spans anywhere on your webpage because we'll use style rules to set their visibility property to hidden. Change the # (pound) signs to your specific links and change the link text to your desired link text. Note that each span is identified by a unique "id" attribute, and that their appearance is defined by the "popMenu" style class.

To define a keyword, place it within an html span element as shown below for the keyword "inkjet printer".

There are basically two different types of printers
in use by the home consumer today. The
<span class="popLink">inkjet printer</span>
or bubble jet printer squirts tiny droplets of ink
on the surface of the paper to form an image.

Note that the appearance of this span is defined by the "popLink" style class. We'll use the span element's onmouseover event to execute a Java Script function named "popUp" to display the keyword's related popup menu. We'll use the span element's onmouseout event to execute a Java Script function named "delay" to close the popup menu. Below is an example of the complete "inkjet printer" keyword span.

<span class="popLink" onmouseover="popUp(event, 'menu1')" onmouseout="delay()">inkjet printer</span>.

The "delay" function will create a short delay, after which it will call a third function named "popHide" to actually close the popup menu. But before I describe the Java Script functions, I provide you with the complete style code for the example.

Web Design Sections

RSS Feed RSS Feed

Easy Java Script Code
Easy Java Script Windows
Easy Rollovers
Easy Picture Transition Effects
Easy Moving Popup Code
Easy Slide Show Code
Easy Slide Show Code With Linked Slides
Slide Show with Different Size Images
Easy Picture Zoom Code
Easy Picture Panning Code
Easy Java Script Animation
Easy JavaScript Picture Selector Code
Easy Animated Banners with Java Script
Easy Java Script Form Validation
Easy Drag n Drop Code
Easy Graph Generating Code
Easy Code to Sort a Table by Column
Easy Fading Text Banner Code
Easy Expanding Banner Code
Calendars for Your Website
Date Picker For Your Web Site
Calculators For Your Web Site
Loan Payment Calculator
Length Units Converter
Body Mass Index
Fahrenheit to Celsius Converter
Decimal to Hexidecimal Converter
Easy Code for Screen Tape Adding Machine
Code for Java Script Circle⁄Sphere Calculator
Round a Float to 4 Digits to the Right of the Decimal Point
Make Your Own Graphical Digital Clock
Let Your Web site Visitors Set Font Size
How to Disable the Browser Back Button
Add More Bang to Your Content With Keyword Popup Menus
Put a Music Off Switch on Your Webpage
Java Script Random Password Generator
Password Protection Using Java Script
Replace Drop-down with Drag-and-drop
Submit Forms Without CGI
Code for a Less annoying Popup Window
Using the Java Script Array Object
Using the Java Script Date Object
Java Script Message Boxes
How to Shuffle the Deck With Java Script
Web Site Menus : Which Section Am I In?
How Far Did the User Scroll?
Where Did the User Click?
Four Ways to Use Java Script Event Handlers
Create Your Own Database Using Only Notepad : CDV

[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2007 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269