question about putting variable in style change script

I

insideview

How do I do something, where

var x="-20%";

document.all("something").style.top=x


normally, this would work --

document.all("something").style.top='-20%';

but the above formulation doesn't..... is there some diff way?
 
D

Dag Sunde

How do I do something, where

var x="-20%";

document.all("something").style.top=x


normally, this would work --

document.all("something").style.top='-20%';

but the above formulation doesn't..... is there some diff way?

try:

var x="-20%";

document.all("something").style.top= "'" + x + "'";
 
R

RobG

How do I do something, where

var x="-20%";

document.all("something").style.top=x

Provided the browser in question supports document.all, the above
"works".

Do no use document.all in isolation (or at all if IE 4 support is not
required), use document.getElementById with appropriate feature
detection.

normally, this would work --

document.all("something").style.top='-20%';

but the above formulation doesn't..... is there some diff way?

It does work. You may not be getting the result you want, but that is
a question for a CSS group, not here.

news:comp.infosystems.www.authoring.stylesheets
<URL:
http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li&hl=en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top