[Fwd: [Javascript] moving layers in NN 6]

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Thu Oct 17 11:22:14 CDT 2002


Hi Manuel 

This is pretty easy to do.
You must use
NS6 & IE 5 and over 
document.getElementById('layer1').style.left += 10

Under IE 5 version you must use 
document.all.Layer1.style.pixelLeft += 10;	

and ofcourse NS4

document.Layer1.x += 10;

I recommend you to build a function like this

function get_obj(layerName){
var obj=""
	if(document.layers){//NS4
		obj=document.layers[layerName];
	}else if(document.getElementById){//IE 5 and over and NS6
		obj=document.getElementById(layerName).style
	}else if(document.all && !document.getElementById){
		obj=document.all[layerName].style
	}
return obj
}

and just call it that way 

get_obj('layer').left += 10

or if you need to use more than once

var myLayerObj = get_obj('layer')

myLayerObj.left += 10




for some documentation or any dom documentation
http://www.dhtmlcentral.com/
http://www.getelementbyid.com/



-----Original Message-----
From: Manuel Socarras Reyes [mailto:msocarras at terra.es]
Sent: 17 October 2002 15:00
To: javascript at LaTech.edu
Subject: [Fwd: [Javascript] moving layers in NN 6]


  hi:

a couple of days ago i sent this question but no answer, hope now 
somebody can say something about it
--------------------

hi:

// IE
document.all.Layer1.style.pixelLeft += 10;	

// NN 4.x
document.Layer1.x += 10;	

// NN6.x 
what about with it NN 6? i tried with offsetLeft but it seems like if it's a
read only property. 

is there any documentation with the differences between NN 4.x & NN 6.x
and/or a list of 
properties' use in NN 6.x?


TIA,

-- 
Saludos,

Manuel Socarrás Reyes 
Barcelona. Spain



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



-- 
Saludos,

Manuel Socarrás Reyes <msocarras at terra.es>
Barcelona. Spain



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.



More information about the Javascript mailing list