allyson
07-18-2002, 03:45 AM
Hi
The following code works really well in Netscape, but not in IE. It used to work in both browsers. The script comes from codingforum, and writes text as the mouse rolls over the images. It's at http://homepages.ihug.co.nz/~usateden/panacea/entry2.htm
Can anyone help me find the bug.
<style type="text/css">
.mouseText {
font: 200 20px "book antiqua";
color: sienna;
}
.logo {
font-weight: bold;
color: crimson;
}
</style>
<script type="text/javascript" language="javascript">
var MO_text = new Object();
MO_text['default'] = 'Welcoming Statement';
MO_text['artist_of_month'] = 'Find out who is the Panacea Artist of the Month';
MO_text['see_gallery'] ='Come in and see the Panacea Art Gallery';
MO_text['arts_trust'] = 'Find out about the Panacea Arts Trust';
MO_text['ebook'] = 'Use Microsoft Reader to read this website to you';
function getCell(id) {
return document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) :
document.layers ? document['NS' + id].document.layers[0] : null;
}
function setCell(id, content, classname) {
var c = getCell(id);
if (!document.layers) {
c.innerHTML = content;
if (classname) c.className = classname;
} else {
var sSPAN = ((classname) ? '<span class="' + classname + '">' : '<span>');
c.document.write(sSPAN + content + '</span>');
c.document.close();
c.parentLayer.clip.width = c.clip.width;
c.parentLayer.clip.height = c.clip.height;
}
}
</script>
</head>
<body background="images/bg1.jpg">
<p align="center"><img src="images/titlelogo.GIF" width="220" height="54"></p>
<p align="center"><ilayer id="NStextcell"><layer> <span class="mouseText">Welcoming Statement</span> </layer></ilayer></p>
<div align="right">
<table border="0" cellpadding="0" width="90%" cellspacing="0">
<tr>
<td width="25%"></td>
<td width="25%"><a href="artistofthemonth.doc"
onmouseover="setCell('textcell',MO_text['artist_of_month'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'], 'mousetext')"><img src="first.GIF"
width="227" height="138" border="0"></a></td>
<td width="25%"><a href="gallery/index.html"
nmouseover="setCell('textcell',MO_text['see_gallery'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'],mousetext')"><img src="second.GIF"
width="183" height="138" border="0"></a></td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%" valign="top"><a href="frameset/index.html"
onmouseover="setCell('textcell',MO_text['arts_trust'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'],'mousetext')"><img src="third.GIF"
width="227" height="168" border="0"></a></td>
<td width="25%"><a href="ebook.htm"
onmouseover="setCell('textcell',MO_text['ebook'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'], 'mousetext')"><img src="fourth.GIF"
width="180" height="167" border="0"></a></td>
<td width="25%"></td>
</tr>
</table>
</div>
========
bye
Allyson
The following code works really well in Netscape, but not in IE. It used to work in both browsers. The script comes from codingforum, and writes text as the mouse rolls over the images. It's at http://homepages.ihug.co.nz/~usateden/panacea/entry2.htm
Can anyone help me find the bug.
<style type="text/css">
.mouseText {
font: 200 20px "book antiqua";
color: sienna;
}
.logo {
font-weight: bold;
color: crimson;
}
</style>
<script type="text/javascript" language="javascript">
var MO_text = new Object();
MO_text['default'] = 'Welcoming Statement';
MO_text['artist_of_month'] = 'Find out who is the Panacea Artist of the Month';
MO_text['see_gallery'] ='Come in and see the Panacea Art Gallery';
MO_text['arts_trust'] = 'Find out about the Panacea Arts Trust';
MO_text['ebook'] = 'Use Microsoft Reader to read this website to you';
function getCell(id) {
return document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) :
document.layers ? document['NS' + id].document.layers[0] : null;
}
function setCell(id, content, classname) {
var c = getCell(id);
if (!document.layers) {
c.innerHTML = content;
if (classname) c.className = classname;
} else {
var sSPAN = ((classname) ? '<span class="' + classname + '">' : '<span>');
c.document.write(sSPAN + content + '</span>');
c.document.close();
c.parentLayer.clip.width = c.clip.width;
c.parentLayer.clip.height = c.clip.height;
}
}
</script>
</head>
<body background="images/bg1.jpg">
<p align="center"><img src="images/titlelogo.GIF" width="220" height="54"></p>
<p align="center"><ilayer id="NStextcell"><layer> <span class="mouseText">Welcoming Statement</span> </layer></ilayer></p>
<div align="right">
<table border="0" cellpadding="0" width="90%" cellspacing="0">
<tr>
<td width="25%"></td>
<td width="25%"><a href="artistofthemonth.doc"
onmouseover="setCell('textcell',MO_text['artist_of_month'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'], 'mousetext')"><img src="first.GIF"
width="227" height="138" border="0"></a></td>
<td width="25%"><a href="gallery/index.html"
nmouseover="setCell('textcell',MO_text['see_gallery'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'],mousetext')"><img src="second.GIF"
width="183" height="138" border="0"></a></td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%" valign="top"><a href="frameset/index.html"
onmouseover="setCell('textcell',MO_text['arts_trust'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'],'mousetext')"><img src="third.GIF"
width="227" height="168" border="0"></a></td>
<td width="25%"><a href="ebook.htm"
onmouseover="setCell('textcell',MO_text['ebook'],'mousetext')"
onmouseout="setCell('textcell',MO_text['default'], 'mousetext')"><img src="fourth.GIF"
width="180" height="167" border="0"></a></td>
<td width="25%"></td>
</tr>
</table>
</div>
========
bye
Allyson