Hello,
I have a large image which does various mouseover image swaps. I have got this working fine with just one image swap but it does not seem to allow two simultaneous image swaps displaying two images at different locations.
It works for just one mouseover with :
<area shape="rect" coords="229,189,323,249" onmouseover="divup('cus',229,189,0,0,1)">
I have tried this for two mouseovers but this doesnot work: <area shape="rect" coords="134,11,227,70" onmouseover="divup('depcon',133,11,0,0,1); divup('depsec',250,11,0,0,1)">
Each div is difned as :
<div id="depcon" style="visibility:hidden;top:0;left:0;width:95px;height:113px;z-index:3;position:absolute" onmouseout="divdown('depcon')">
<img src="presentation-departure-concourse-mouseover.gif" alt="" hspace="0" vspace="0" border="0" usemap="#depconmap">
</div>
I am wondering if it is something to do with the attached Js file. As I do not know much javascript I was wondering if anyone could advise me on this.
The JS FIle is :
var baseImageState = 0;
var LastDivUp = 0;
function getEl(id) {
if (document.all) {
return document.all.item(id);
}
}
function divup(id, x, y, s1, s2, s3) {
if (LastDivUp != 0) {
divdown(LastDivUp);
}
if ((baseImageState == 0) ||
(s1 && baseImageState == 1) ||
(s2 && baseImageState == 2) ||
(s3 && baseImageState == 3)) {
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
var baseEl = getEl('base');
popupEl.style.left = x + baseEl.offsetLeft;
popupEl.style.top = y + baseEl.offsetTop;
popupEl.style.visibility = "visible";
LastDivUp = id;
}
}
}
}
function divdown(id) {
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
popupEl.style.visibility = "hidden";
LastDivUp = 0;
}
}
}
function hilite (id,x,y) {
if (LastDivUp != 0) {
divdown(LastDivUp);
}
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
var baseEl = getEl('base');
popupEl.style.left = x + baseEl.offsetLeft;
popupEl.style.top = y + baseEl.offsetTop;
popupEl.style.visibility = "visible";
LastDivUp = id;
}
}
}
All help greatly appreciated
I have a large image which does various mouseover image swaps. I have got this working fine with just one image swap but it does not seem to allow two simultaneous image swaps displaying two images at different locations.
It works for just one mouseover with :
<area shape="rect" coords="229,189,323,249" onmouseover="divup('cus',229,189,0,0,1)">
I have tried this for two mouseovers but this doesnot work: <area shape="rect" coords="134,11,227,70" onmouseover="divup('depcon',133,11,0,0,1); divup('depsec',250,11,0,0,1)">
Each div is difned as :
<div id="depcon" style="visibility:hidden;top:0;left:0;width:95px;height:113px;z-index:3;position:absolute" onmouseout="divdown('depcon')">
<img src="presentation-departure-concourse-mouseover.gif" alt="" hspace="0" vspace="0" border="0" usemap="#depconmap">
</div>
I am wondering if it is something to do with the attached Js file. As I do not know much javascript I was wondering if anyone could advise me on this.
The JS FIle is :
var baseImageState = 0;
var LastDivUp = 0;
function getEl(id) {
if (document.all) {
return document.all.item(id);
}
}
function divup(id, x, y, s1, s2, s3) {
if (LastDivUp != 0) {
divdown(LastDivUp);
}
if ((baseImageState == 0) ||
(s1 && baseImageState == 1) ||
(s2 && baseImageState == 2) ||
(s3 && baseImageState == 3)) {
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
var baseEl = getEl('base');
popupEl.style.left = x + baseEl.offsetLeft;
popupEl.style.top = y + baseEl.offsetTop;
popupEl.style.visibility = "visible";
LastDivUp = id;
}
}
}
}
function divdown(id) {
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
popupEl.style.visibility = "hidden";
LastDivUp = 0;
}
}
}
function hilite (id,x,y) {
if (LastDivUp != 0) {
divdown(LastDivUp);
}
if (document.all) {
var popupEl = getEl(id);
if (popupEl != null) {
var baseEl = getEl('base');
popupEl.style.left = x + baseEl.offsetLeft;
popupEl.style.top = y + baseEl.offsetTop;
popupEl.style.visibility = "visible";
LastDivUp = id;
}
}
}
All help greatly appreciated