473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

question about putting variable in style change script

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?

Oct 13 '06 #1
2 1139
<in********@gmail.comskrev i melding
news:11**********************@b28g2000cwb.googlegr oups.com...
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 + "'";

--
Dag.
Oct 13 '06 #2
in********@gmail.com wrote:
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.

<URL: http://www.jibbering.com/faq/#FAQ4_26 >

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/co...s?lnk=li&hl=en
>

--
Rob

Oct 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
11
by: NS | last post by:
I am relativly new to css positioning and have a question regarding the display of a DHTML pop-up Here is the basic HTML I am using: <html> <head> <script language="JavaScript"> <!--
27
by: Terry Olson | last post by:
I'm trying to build a table on an output page based on text input by the user. And what I am trying to do is create 4 table data boxes on a row, then start a new row on the 5th one. But I can't...
2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
7
by: Randell D. | last post by:
Folks, I have a Javascript performance question that I might have problems explaining... In PHP, better performance can be obtained dealing directly with a variable, as opposed to an element...
8
by: George | last post by:
I need help with the code listed below. See the line below the comment-// *** This displays the error *** I want to be able to have the event handler call the function based on the reference...
13
by: Paul | last post by:
Hi I have a .net application that shows the start page for a few seconds and then goes to another start page. I was wondering if it would be possible to put a count on the page to let the user...
4
by: Jon | last post by:
All, I have a question regarding include files. I'm currently wanting to secure all of the pages within a directory by having a login script that queries a MySQL DB, and writes a session...
19
by: the other john | last post by:
I'm trying to enhance a script to do the following things. 1). detect the first four words of a paragraph and stylize them (already does that) 2). Capitalize and stylize the first letter of each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.