I'm generating and showing a series of geographic image maps. For 1 screen resolution, I have to adjust the position of each map in the series. The reposition works for the 1st image, but not any of the subsequent images. The code that moves through the series of images follows.
var divNum = 0;
function rotate() { // Simulation.
var nx = divNum + 5;
var daDiv = 'yr' + divNum;
if (divNum != 0) {
var daDivPrev = 'yr' + (divNum - 1);
var cmdx = daDivPrev + \".style.visibility='hidden';\";
eval(cmdx);
}
document.getElementById(daDiv).style.zIndex = '' + nx;
if (screen.height == 768) {
document.getElementById('mapx').style.position = 'absolute';
document.getElementById('mapx').style.left = '26%';
}
var cmdx = daDiv + \".style.visibility='visible';\";
eval(cmdx);
if (divNum > 3) return; // Stop at 4 because of advance number.
divNum++; // advance divNum to next div ID
setTimeout('rotate();', 3000);
}
setTimeout('rotate()', 2000); // Rotate.
The 'mapx' div is wrapped around the img tag just prior to the map generation.