473,406 Members | 2,259 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.

using vars in div style tag

I have a menu that stretches across the top of a series of pages, and I need
to be able to change all 8 div's absolute position. Here's a snippet of the
code I am
using:

<div id="layer1" style="position:absolute; width:auto; height:auto; top:1px;
left:50px">

What I need is to be able to change that 'left:50px' to the equiv of
"left:layer1_pos">

any suggestions on how to go about this??


Jul 23 '05 #1
4 6929

"ScooterMX" <sc*****@nowhere.org> wrote in message
news:cM****************@newssvr21.news.prodigy.com ...
I have a menu that stretches across the top of a series of pages, and I need to be able to change all 8 div's absolute position. Here's a snippet of the code I am
using:

<div id="layer1" style="position:absolute; width:auto; height:auto; top:1px; left:50px">

What I need is to be able to change that 'left:50px' to the equiv of
"left:layer1_pos">

any suggestions on how to go about this??


You need to be using a server technology like ASP, ASP.NET, Java servlets,
PHP, CGI, et al., that generates HTML pages programmatically.

Jul 23 '05 #2

"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:34*************@individual.net...

"ScooterMX" <sc*****@nowhere.org> wrote in message
news:cM****************@newssvr21.news.prodigy.com ...
I have a menu that stretches across the top of a series of pages, and I

need
to be able to change all 8 div's absolute position. Here's a snippet of

the
code I am
using:

<div id="layer1" style="position:absolute; width:auto; height:auto;

top:1px;
left:50px">

What I need is to be able to change that 'left:50px' to the equiv of
"left:layer1_pos">

any suggestions on how to go about this??


You need to be using a server technology like ASP, ASP.NET, Java servlets,
PHP, CGI, et al., that generates HTML pages programmatically.


This is on an .asp page. And actually any page that can render css can do
this, not just server side. css/dhtml is a client side rendering.

What I need to figure out is how to access the layers properties, or more
accurately, WHEN to. I think that I can set the div's stlye tag like this:

document.layer1.left=50

but I'm not sure when to do that, syntax-wise...
Jul 23 '05 #3

"ScooterMX" <sc*****@nowhere.org> wrote in message
news:P6****************@newssvr21.news.prodigy.com ...

"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:34*************@individual.net...

"ScooterMX" <sc*****@nowhere.org> wrote in message
news:cM****************@newssvr21.news.prodigy.com ...
I have a menu that stretches across the top of a series of pages, and
I need
to be able to change all 8 div's absolute position. Here's a snippet
of the
code I am
using:

<div id="layer1" style="position:absolute; width:auto; height:auto; top:1px;
left:50px">

What I need is to be able to change that 'left:50px' to the equiv of
"left:layer1_pos">

any suggestions on how to go about this??


You need to be using a server technology like ASP, ASP.NET, Java servlets, PHP, CGI, et al., that generates HTML pages programmatically.


This is on an .asp page. And actually any page that can render css can do
this, not just server side. css/dhtml is a client side rendering.

What I need to figure out is how to access the layers properties, or more
accurately, WHEN to. I think that I can set the div's stlye tag like

this:
document.layer1.left=50

but I'm not sure when to do that, syntax-wise...


OK, I understand now. Since you had put this in an HTML group, I had assumed
it was an HTML question and that you didn't realize this couldn't be done
through HTML. The answer is

document.getElementById("layer1").style.left = 50;

Jul 23 '05 #4
ScooterMX wrote:
I have a menu that stretches across the top of a series of pages, and
I need to be able to change all 8 div's absolute position.Here's a
snippet of the code I am using: <div id="layer1" style="position:absolute; width:auto; height:auto;
top:1px; left:50px">


Remove the inline style attribute from the DIVs, add this to the pages'
HEAD element:

<link rel="stylesheet" type="text/css" href="style.css">

Then create a file called style.css and put this in it:

#layer1 {
position: absolute;
width: auto;
height: auto;
top: 1px;
left: 50px;
}
Jul 23 '05 #5

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

Similar topics

0
by: Alex | last post by:
I'm running Apache 2.0.47, PHP 4.3.3 on RedHat 9.0 on a new server. I have a series of pages that let's say pages 1 -> 3 are non-ssl and 4-8 are SSL but the URL domain is different (shared SSL)....
2
by: AJ | last post by:
Ok, I have a "form" class, which I am going to use to generate HTML forms. I also have a form_input, which I use to generate the individual HTML input elements. What I want to do is some...
2
by: Christian Decker | last post by:
I wanted to know if is a good idea to create classes that mirror exactly the structure of a database. This might sound a bit fuzzy but I'l explain myself with an example: CREATE TABLE...
3
by: Christopher J. Bottaro | last post by:
Hello, Lets say I have a class instance with the following member vars: var1, x, size. Now lets say I have dict with the following keys: var1, x, size. Is there an easy way to *automatically*...
0
by: Oliver | last post by:
hi - ...I've just spent half my life trying to work out how to apply TableStyles to a datagrid that is bound to an object rather than a database table. - when working with relational data one...
0
by: Brett | last post by:
I am working with vb.net in a asp.net application. I have created a config file in xml format. The goal is to be able to change the config file without having to recompile the entire...
1
by: news.wanadoo.nl | last post by:
Hi, I have found whit google this form in this group. But i'n not good in javascript :(. I try and error normal but i only error now :P Whit i now want to now how can i get access to the vars...
19
RMWChaos
by: RMWChaos | last post by:
Previously, I had used independent JSON lists in my code, where the lists were part of separate scripts. Because this method did not support reuse of a script without modification, I decided to...
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.