Click to See Complete Forum and Search --> : New and interesting NetScape problems


AndrewA
10-16-2003, 10:17 AM
I'm writing a website which uses a loy of layers , in the form of DIV tags, but i've run into som eproblems using NetScape. I've looked up the archives but I can't really find something which helps me here.

There are 2 problems really. The first one is if got a mouseover event on a DIV which changes the Text of layer using a DreamWeaver generated function:

function MM_setTextOfLayer(objName,x,newText) { //v3.0
if ((obj=MM_findObj(objName))!=null) with (obj)
if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
else innerHTML = unescape(newText);
}

like this. Right Netscape 4 doesnt support onmouseover in DIV's but that fine but in Netscape 7 instead of setting the Layer text it displays the text in the browser window and non of the rest of the page. The question is do I have to change the set text function or just disable it compleltly in all Netscape browsers.

Second question isn't really JavaScript related but it related to my previous problem. I've got some nice DIV's with text in them on the page. In IE they show up fine but in NetScape 7 the background colour box and text are not in the same place. It looks like the text isn't inside the DIV at all. It only happens on DIV's which have a specified size and the text runs onto more than one line causing the Layer to autosize it'self to fir the text.

Thanks for your help.

Andrew A.

Khalid Ali
10-16-2003, 01:51 PM
for the first part of your question,I bet its because of
document.write

statement.It seems like its being executed after the page is loaded.In this case what you are seeing is correct,because once the document is loaded and you use document.write it over writes current document.

Your second question will be solved with a bit of playing with the css position property