dianefoster Posted November 13, 2016 Share Posted November 13, 2016 <ul> <li><a href="adelaide.html" class = "caption">Adelaide</a></li> <li><a href="alicesprings.html" class ="caption" id="central" Alice Springs</a></li> <li><a href= broome.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 More sharing options...
Larry Posted November 14, 2016 Share Posted November 14, 2016 Hey! Beyond the post title, could you add some more context as to what you're asking here? I thiiink the answer is that "theLink" is populated when the setupRollover() function is called, once for each link, but I'm not positive that's what you're asking about. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts