Closed Thread Icon

Preserved Topic: some NS 6 DHTML instructions Pages that link to <a href="https://ozoneasylum.com/backlink?for=15600" title="Pages that link to Preserved Topic: some NS 6 DHTML instructions" rel="nofollow" >Preserved Topic: some NS 6 DHTML instructions\

 
Author Thread
Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-06-2000 03:29

A lot of people seemed scared about this, so, if you are already good with DHTML for IE and NN 4.x, you can read these instructions to learn how to do most of it for N6. I discovered this stuff as I worked on my most recent page.

document.getElementById("idhere")
&nbsp;is the same as IE's
document.all.idhere

Getting it any other way can be complicated, and involves things called "nodes", you have to work your way down to it, like document.body.nodelist[0].nodelist[5]. (that's not really the right code, but you get the idea.)

To get the left and top position of an object, use:

parseInt(document.getElementById("idhere").style.top)

the parseInt function is necessary because just using

document.getElementById("idhere").style.top
document.getElementById("idhere").style.left

will give you something like "60px". the parseInt function takes just the number part.

To set (or get) the visibility of an object, use

document.getElementById("idhere").style.visibility

that can be set to "hidden" or "visible".

To get the height or width of a layer, use:

parseInt(document.getElementById("idhere").style.height)
parseInt(document.getElementById("idhere").style.width)

Again, you need the parseInt function for the same reason.

If you are *setting* the top, left, width, or height, then you should *not* use parseInt. If you set it to 53, it will make it "53px" by itself.

OK, two more things. To set the innerHTML of a layer, use:

document.getElementById("idhere").innerHTML

And to set the Z Index of a layer, use

document.getElementById("idhere").style.zIndex

Again, to *read* the Z Index, you will need the parseInt function.

Oh, and in all of the above, "idhere" is what was set in the style sheet with #idhere and used in a DIV tag with id="idhere".

OK, did I cover everything? I hope that helps!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-06-2000 03:36

Wow, just read my own post... I'm not the best at explaining things, am I? Hopefully you can decipher what I wrote.

bunchapixels
Neurotic (0) Inmate
Newly admitted
posted posted 12-06-2000 03:59

wow, that's a fantatstic help, slime - im a little less scared now!
<img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif">

Weadah
Maniac (V) Mad Scientist

From: TipToToe
Insane since: Aug 2000

posted posted 12-06-2000 06:40

Hey cheers Slime - I'm a lil more scared now.

Rick
Paranoid (IV) Inmate

From: Borneo Island
Insane since: Apr 2000

posted posted 12-06-2000 06:48

That's scared me too, but thanx to Mr. Slime..

« BackwardsOnwards »

Show Forum Drop Down Menu