CoffeeQuick
Programmer
I have a web page that has 3 maps each in a separate div hidden off the side of the page. When you click a button the chosen map then scrolls into view.
This part of the code works fine in IE, Opera and Firefox, but when it comes to hide the maps again, the script to hide doesn't work in Firefox (works fine on IE and Opera).
This is the script to show a map.
And this is the script to hide the map
There is a separate script to show each map, but a generic one to hide the maps. I have tried putting a document.getElementById("map1") command into the hide script, instead of passing the div id as a variable, but this makes no difference.
Can anyone see why this is happening, and suggest a fix that will work in all 3 browsers.
Thanks.
John
This part of the code works fine in IE, Opera and Firefox, but when it comes to hide the maps again, the script to hide doesn't work in Firefox (works fine on IE and Opera).
This is the script to show a map.
Code:
function showMap1() {
hiddenLayer = document.getElementById("map1");
layerPosition = parseInt(hiddenLayer.style.left);
if (layerPosition < 0) {
hiddenLayer.style.left = (layerPosition + 2) + "px";
setTimeout("showMap1()", 5);
}
}
And this is the script to hide the map
Code:
function hideLayer(Tablayer, dis) {
Tablayer.style.left = dis + "px";
}
There is a separate script to show each map, but a generic one to hide the maps. I have tried putting a document.getElementById("map1") command into the hide script, instead of passing the div id as a variable, but this makes no difference.
Can anyone see why this is happening, and suggest a fix that will work in all 3 browsers.
Thanks.
John