Spire2000
12-18-2003, 10:05 AM
I have used ImageReady to create some rollover Javascript code for some buttons I have designed for my site. Everything works great on my development machine, but when moved to the server and viewed with IE 4 (which is what we're limited on our Intranet), the rollover features don't work. The image is displayed fine, and the hyperlink still works, but nothing else.
Here is the Javascript in the header:
<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) {
diob_move_01_over = newImage("images/diob_move_01-over.gif");
diob_move_01_down = newImage("images/diob_move_01-down.gif");
preloadFlag = true;
}
}
// -->
</SCRIPT>
And here are the rollovers:
$output->Text('<table>');
$output->Text('<tr>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move_01\', \'images/diob_move_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move_01\', \'images/diob_move_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move_01\', \'images/diob_move_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move_01\', \'images/diob_move_01-over.gif\'); return true;">
<IMG NAME="diob_move_01" SRC="images/diob_move_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DIOB"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move02_01\', \'images/diob_move02_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move02_01\', \'images/diob_move02_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move02_01\', \'images/diob_move02_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move02_01\', \'images/diob_move02_01-over.gif\'); return true;">
<IMG NAME="diob_move02_01" SRC="images/diob_move02_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DEM"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move03_01\', \'images/diob_move03_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move03_01\', \'images/diob_move03_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move03_01\', \'images/diob_move03_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move03_01\', \'images/diob_move03_01-over.gif\'); return true;">
<IMG NAME="diob_move03_01" SRC="images/diob_move03_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DCDS"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'watch_01\', \'images/watch_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'watch_01\', \'images/watch_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'watch_01\', \'images/watch_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'watch_01\', \'images/watch_01-over.gif\'); return true;">
<IMG NAME="watch_01" SRC="images/watch_01.gif" WIDTH=144 HEIGHT=29 BORDER=0 ALT="NDCC Watch"></A>');
$output->Text('</td>');
$output->Text('</tr>');
$output->Text('</table>');
Ignore the $output->text stuff, as that's just my method of plugging it into my PHP script. Also, I have added a few carriage returns to the code above to make it readable on these fourms without stretching the page across the horizon.
Anyone have any ideas what I can do to makethis work in IE 4? I'm not sure what part of the ImageReady code is causing a conflict with the browser, so I don't know quite where to start looking for a solution.
Any help would be greatly appreciated.
Here is the Javascript in the header:
<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) {
diob_move_01_over = newImage("images/diob_move_01-over.gif");
diob_move_01_down = newImage("images/diob_move_01-down.gif");
preloadFlag = true;
}
}
// -->
</SCRIPT>
And here are the rollovers:
$output->Text('<table>');
$output->Text('<tr>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move_01\', \'images/diob_move_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move_01\', \'images/diob_move_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move_01\', \'images/diob_move_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move_01\', \'images/diob_move_01-over.gif\'); return true;">
<IMG NAME="diob_move_01" SRC="images/diob_move_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DIOB"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move02_01\', \'images/diob_move02_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move02_01\', \'images/diob_move02_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move02_01\', \'images/diob_move02_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move02_01\', \'images/diob_move02_01-over.gif\'); return true;">
<IMG NAME="diob_move02_01" SRC="images/diob_move02_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DEM"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'diob_move03_01\', \'images/diob_move03_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'diob_move03_01\', \'images/diob_move03_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'diob_move03_01\', \'images/diob_move03_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'diob_move03_01\', \'images/diob_move03_01-over.gif\'); return true;">
<IMG NAME="diob_move03_01" SRC="images/diob_move03_01.gif" WIDTH=72 HEIGHT=29 BORDER=0 ALT="DCDS"></A>');
$output->Text('</td>');
$output->Text('<td><A HREF="#" ONMOUSEOVER="changeImages(\'watch_01\', \'images/watch_01-over.gif\'); return true;"
ONMOUSEOUT="changeImages(\'watch_01\', \'images/watch_01.gif\'); return true;"
ONMOUSEDOWN="changeImages(\'watch_01\', \'images/watch_01-down.gif\'); return true;"
ONMOUSEUP="changeImages(\'watch_01\', \'images/watch_01-over.gif\'); return true;">
<IMG NAME="watch_01" SRC="images/watch_01.gif" WIDTH=144 HEIGHT=29 BORDER=0 ALT="NDCC Watch"></A>');
$output->Text('</td>');
$output->Text('</tr>');
$output->Text('</table>');
Ignore the $output->text stuff, as that's just my method of plugging it into my PHP script. Also, I have added a few carriage returns to the code above to make it readable on these fourms without stretching the page across the horizon.
Anyone have any ideas what I can do to makethis work in IE 4? I'm not sure what part of the ImageReady code is causing a conflict with the browser, so I don't know quite where to start looking for a solution.
Any help would be greatly appreciated.