Jump to content
Larry Ullman's Book Forums

Confused About Thelink And How To Get It And How To Get The Link


Recommended Posts

<ul>

    <li><a href="adelaide.html" class = "caption">Adelaide</a></li>

    <li><a href="alicesprings.html" class ="caption" id="central" Alice Springsarrow-10x10.png</a></li>

    <li><a href= broomearrow-10x10.png.html" class  ="caption" id="broome" >Broome</a>

    </li>

    <li><a href="cairns.html" class  ="caption" id="cairns" >Cairns</a>

    </li>

    <li><a href="canberra.html" class  ="caption" id="canberra" >Canberra</a>

    </li>

   

  </ul>

window.onload = rolloverInit;

 

function rolloverInit() {

     for (var i=0; i<document.links.length; i++) {

        var linkObj = document.links;

        if (linkObj.className) {

           var imgObj = document.getElementById(linkObj.className);

           if (imgObj) {

                setupRollover(linkObj,imgObj);

           }

        }

     }

}

 

function setupRollover(theLink,textImage) {

     theLink.imgToChange = textImage;

     theLink.onmouseout = function() {

        this.imgToChange.src = this.outImage.src;

     }

     theLink.onmouseover = function() {

        this.imgToChange.src = this.overImage.src;

     }

 

     theLink.outImage = new Image();

     theLink.outImage.src = textImage.src;

 

     theLink.overImage = new Image();

     theLink.overImage.src = "images/" + theLink.id + "Text.gif";

}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...