Jump to content



Photo
- - - - -

Can't Get The Images To Rollover When Mouseover Links

image rollovers

  • Please log in to reply
1 reply to this topic

#1 dianefoster

dianefoster

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 4 December 2016 - 8:36 AM

<li><a href = "adelaide.html"   id ="ade" a.mouseout ="function()" a.mouseover ="function()" >Adelaide</a></li>
    <li><a href="alicesprings.html"  class ="caption" id ="alicesprings" >Alice Springs</a></li>
    <li><a href="broome.html"   >Broome</a>
    </li>
    <li><a href="cairns.html" >Cairns</a>
    </li>
    <li><a href="canberra.html"  >Canberra</a>
    </li>
    
  </ul>
</div>
<div id ="div13">
<ul>
<li><a href ="darwin.html">Darwin</a></li>
<li><a href ="goldcoast.html">Gold Coast</a></li>
<li><a href ="hobart.html">Hobart</a></li>
<li><a href ="regionalcities.html">Regional Cities</a></li>
</ul>
</div>
<div id ="div15">
<ul>
<li><a href ="bluemountains.html">Blue Mountains</a></li>
<li><a  href ="byronbay.html">Byron Bay</a></li>
<li><a href ="flindersranges.html">Flinders Ranges</a></li>
<li><a href ="frazerisland.html">Frazer Island</a></li>
<li><a href ="freycinet.html">Freycinet</a></li>
<li><a href ="gippsland.html">Gippsland</a></li>
<li><a href ="kakadu.html">Kakadu</a></li>
</ul>
</div>
<div id ="div16">
<ul>
<li><a href ="namadjinationalpark.html">Namadji Park</a></li>
<li><a href ="ningaloo.html">Ningaloo</a></li>
<li><a href ="tasmanianwilderness.html">Tasmanian Wilderness</a></li>
<li><a href ="australianalps.html">Australian Alps</a></li>
<li><a href ="kimberley.html">Kimberley</a></li>
<li><a href ="margaretriver.html">Margaret River</a></li>
</ul>
</div>
<div id ="div14">
    <img src="images/australiaMap.jpg"  id ="img9" alt=""/> </div>
</div>
</div>

// JavaScript Document
"use strict";
window.onload =rolloverInit;
function rolloverInit() {
for(var i =0;i<document.links.length;i++)
{
var linkObj = document.links[i];
if(a.caption) {
var imgObj = document.getElementByClassName(a.caption);
if(australiaMap) {
setupRollover(a,australiaMap);
}
}
}
}
function setupRollover(a,australiaMap) {
a.imgToChange = australiaMap;
a.onmouseout =function() {
this.adelaide5.src  = this.australiaMap.src;
}
a.onmouseover = function() {
this.australiaMap.src = this.adelaide5.src;
}
a.outImage = new Image();
a.australiaMap.src ="images/" + "australiaMap.jpg";
a.overImage = new Image();
a.adelaider5.src  ="images/" + a.ade + "adelaide5.jpg";
}

 Dear Larry I got this script from Visual Quickstart Guide  9th   Edition by Tom Negrino  on page 99 I really appreciate you replying to me. Cheers Diane


  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4749 posts
  • LocationState College, PA (USA)

Posted 5 December 2016 - 8:40 AM

I replied to your other post on the same subject. Please continue that thread.


  • 0