I’m new to Javascript, so please forgive if this question is elementary…
I’m using two scripts on the same page. Turns out one of the preload functions is causing the other script not to work.
The first script is for the image map:
[code=php]
<SCRIPT TYPE=”text/javascript”>
<!–
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
var preloadFlag = false;
function preloadImages() {
if (document.images) {
navbar_01_navbar_03_over = newImage(“../../images/navbar/navbar_01-navbar_03_over.jpg”);
navbar_01_navbar_13_over = newImage(“../../images/navbar/navbar_01-navbar_13_over.jpg”);
ETC
The second script is for an image viewer:
[code=php]
<script src=”dw_core.js” type=”text/javascript”></script>
<script src=”dw_scroll.js” type=”text/javascript”></script>
<script type=”text/javascript”>
<!–
var pgLoaded = false;
var wndo = new Array(); // “window(s)” for scrollable content
function initScrLyr() {
pgLoaded=true;
// creat scrollable content area
// arg: id of div containing scrollable div(s)
wndo[0] = new dynObj(‘wn’);
// load scrolling content
// arg’s: array number of wndo, id of scroll div, id of table
loadScrLyr(0,’lyr1′,’t1′);
}
window.onload = initScrLyr;
//–>
</script>
The BODY TAG:
[code=php]<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD=”preloadImages();”>
When I take out the “preloadImages();” line, the image viewer works, but the rollovers on the image map don’t.
Is there any way to get these two scripts to play nice together?
Thank you in advance.