PDA

View Full Version : Not working in Internet Explorer


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

Gordo
07-18-2002, 03:59 AM
While the link to YOUR page is helpful and greatly appreciated, it would help me diagnose your problem if I knew the exact script you're using. I need to see the original script. BUT, you removed the credits to the script (shakes finger at Ms. Allyson). So, until then...I can't help you.

allyson
07-18-2002, 10:36 AM
Hi

At this location, the script works well in both IE and Netscape. But I've found that I when I've tried to move the text to the top of the screen, instead of the right side, the result works in Netscape, but not IE. I don't know why.

http://homepages.ihug.co.nz/~usateden/panacea/entry_test2.htm . (The concept works in both IE and Netscape at this location).


http://homepages.ihug.co.nz/~usateden/panacea/entry2.htm . (This works in netscape, but not IE)


Please help.

bye
Allyson

Cloudski
07-18-2002, 10:52 AM
Hmmmmm... I think I see your problem. Try this..

Change:

<ilayer id="NStextcell"><layer> <span class="mouseText">Welcoming Statement</span> </layer></ilayer>


To:

<table border="0" cellpadding="0" cellpspacing="0" width="410">
<TR>
<td id="textcell" valign="top"><ilayer id="NStextcell"><layer> <span class="mouseText">Introductory message
(default)</span> </layer></ilayer> </td>
</TR>
</table>


I am basing this off of your origional cell sizing.... you may need to resize table for your needs. Also, leave the <p align="center>...</p> that the code goes between. :)

I hope that helped! :D

allyson
07-19-2002, 05:30 AM
Hi

Thank-you, it's fantastic. The changes work well.