473,320 Members | 1,831 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,320 software developers and data experts.

ahhh!

Is there any way to pass the value of a javascript variable to a DIV
property value, e.g. <div style="position:absolute; top: 'gap'+px';> ... so
basically i want the div top property to be the variable gap from my
javascript. any ideas?

decibel
Jul 20 '05 #1
1 1128
<script language = "javascript" type = "text/javascript">

var gap = document.getElementById('theDIV').style;

gap.top = '100px';

// or

gap.top = 100;

</script>

decibel wrote:
Is there any way to pass the value of a javascript variable to a DIV
property value, e.g. <div style="position:absolute; top: 'gap'+px';> ... so
basically i want the div top property to be the variable gap from my
javascript. any ideas?

decibel

Jul 20 '05 #2

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

Similar topics

6
by: Peter Abel | last post by:
I have an application, which is an instance of a class with a deeply nested object hierarchy. Among others one method will be executed as a thread, which can be stopped. Everything works fine...
33
by: Nick Evans | last post by:
Hello there, I have been on and off learning to code (with python being the second language I have worked on after a bit of BASIC). What I really want to know is, if you are going to actually...
10
by: John | last post by:
Ok, I posted in here a few days ago about a problem with apostrophes in text fields and I tried a few of the suggestions and now I'm in so deep I looking at scraping the whole thing because now I...
11
by: Jerry Boone | last post by:
(Sigh) I have sympathy for Starwars, Don, Jesness, MrT, and all the other schizophrenic sides of his mind... As for CDMA contributors, I have been and will be one probably for a long time, but I...
98
by: jacob navia | last post by:
<< QUOTE It is NOT a C compiler, because it doesn't conform to any commonly accepted C specification (K&R, C89, C99). You have no right to call it a C compiler until you get it to conform quote...
3
by: rob1991 | last post by:
Right my problem is.. On my website i want to use a box that scrolls otherwise it pushes the box it is in out of shape and horrible but anyway.. im doing this.. <TEXTAREA id=blah rows=19...
11
by: blunt | last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some...
3
by: jmprescott | last post by:
So I just trashed my project, and of course I didn't save a backup. I needed to change the path for my database I was referencing, and before I figured out the right way to do it, I just deleted...
2
by: muddler | last post by:
I would like to connect to a remote sql server using a stored procedure. I had planned on using OPENQUERY( linked_server ,'query' ) to pull data from the remote server but this command does not...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.