Closed Thread Icon

Topic awaiting preservation: Dinamically writing to layers (NE4+) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8439" title="Pages that link to Topic awaiting preservation: Dinamically writing to layers (NE4+) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Dinamically writing to layers (NE4+) <span class="small">(Page 1 of 1)</span>\

 
CodeTracker
Obsessive-Compulsive (I) Inmate

From: Massachusetts, USA
Insane since: Dec 2002

posted posted 12-16-2002 00:01

I have this code that works perfect in latest browsers (I mennaged to do that) but I just can not make it work in NE4...
I would really appreciate if somebody can help me to modify it.

this is the code:

code:
function writetoLyr(name, message) {
if (document.layers) {
document.layers[name].document.close();
document.layers[name].document.write(message);
document.layers[name].document.close();
} else {
if (document.all) {
document.all[name].innerHTML = message;
} else {
document.getElementById(name).innerHTML = message;
}
}
}



Thanks in advance.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-16-2002 00:09

Change

document.layers[name].document.close();
document.layers[name].document.write(message);
document.layers[name].document.close();

to

document[name].document.write(message);
document[name].document.close();

You only want to close the layer's document after its contents have been changed. Also, I'm not sure if using document.layers[name] works exactly the same as just document[name], so I changed that too.

CodeTracker
Obsessive-Compulsive (I) Inmate

From: Massachusetts, USA
Insane since: Dec 2002

posted posted 12-16-2002 00:21

I don't know what is wrong but still doesn't work in NE4+!!! Any idea???

Thanks.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-16-2002 00:37

Unless I'm overlooking something, we'll have to see the page. I think this function itself is fine.

CodeTracker
Obsessive-Compulsive (I) Inmate

From: Massachusetts, USA
Insane since: Dec 2002

posted posted 12-16-2002 01:30

You can check the code in here.
(This is just a sample that I put together with the codes that I use, so please disregard other html staff unless it has to do with the layers and what I'm trying to achive in here)

Thanks




[This message has been edited by CodeTracker (edited 12-16-2002).]

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 12-16-2002 02:43

I think you may have a problem there. First of all, you will need to include a position attribute to the div properties like:

#left {position:absolute; color: blue;}

That should make the function work *however* what you really want is the div to stay within the table cell but I have never gotten the dynamic write working by setting the position attribute to relative instead of absolute.

So you may want to rethink how you're laying out the page by using the table for all your positioning. Of course this all works fine in IE so I might ask, how critical is it to have this work in NN4?

. . : slicePuzzle

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-16-2002 04:12

Yeah, for this to work in NN4 the element must be absolutely positioned. So consider Bug's question =)

CodeTracker
Obsessive-Compulsive (I) Inmate

From: Massachusetts, USA
Insane since: Dec 2002

posted posted 12-16-2002 05:15

Well, looks like I got some work to do... thanks for help (all of you) ... I got the idea.

P.S. After I added the absolute position it works, but not as I wanted. Looks like "div" wants to be superior to tables...


Peace out....



Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 12-16-2002 05:20

There is something I've always wanted to try but never got around to, and that is to put 1px by 1px blank images in the table cells and then have a script that detects their positions and then set the div position to them.

« BackwardsOnwards »

Show Forum Drop Down Menu