All we need to do now is call the assocaited functions from an event handler like so:
<div id="link1" style="position:absolute; top:44px; left:162px; z-index: 3;">
<a href="#" onmouseover="getPosition('link1');glideMenu('pointer')">
Link 1</a>
</div>
The only other thing to note is that
if you want to change the script from moving horizontally to moving
vertically, then change all references to offsetLeft to offsetTop and
also change all references in the script from left to top and you have
a vertically based version of this script.
Line 16:A new variable called el
(short for element) is defined and is pointed to the
document.getElementById(obj) ; statement. This allows us to create a
JavaScript object of any element we identify with the obj argument by
looking at its id value and then passing it to the function.
Download Gliding Navigation Bar Example
View Finished Example