473,401 Members | 2,125 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,401 software developers and data experts.

Moving DIVs?


Hi,
this is where the DIVs of a menu get created:
<div id="menudivs" class="m' + this.container.id + 'l' + this.depth +
'i">'
+ this.fields[0] + "</div>

How do I loop through all of them and move them by "dx" horizontally.
(I want to put this in a window.onresize event handler)

Thank you,

--
-Gernot

Post here, don't email. If you feel you have to mail, revert my
forename from:
to******************************@invalid.com
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
Jul 23 '05 #1
2 3582
Gernot Frisch wrote:
this is where the DIVs of a menu get created:
<div id="menudivs" class="m' + this.container.id + 'l' + this.depth +
'i">'
+ this.fields[0] + "</div>

How do I loop through all of them and move them by "dx" horizontally.
RTFM. There are two ways:

A) Move each "div" element. Obtain the collection of elements with
document.getElementsByTagName() (W3C), document.all() (IE4+) or
document.layers (NN4), then test against the className property
of each element object.

B) Change the value of the left property in the class selector
(not in NS4 and Opera). Obtain the list of stylesheets for
the document with document.styleSheets and the rules with
the document.styleSheets[...].cssRules (Gecko) or the
document.styleSheets[...].rules (IE) collection.
(I want to put this in a window.onresize event handler)


Oh my. Use a proper stylesheet instead. What if client-side script
support is restricted or disabled or the DOM does not support that at
all? Thought about the user's system resources?
PointedEars

P.S.:
Me@privacy.net is not a mailbox address ("A mailbox receives mail"):

| Me@Privacy.net
| SMTP error from remote mailer after RCPT TO:<Me@privacy.net>:
| host privacy.net [66.46.181.115]:
| 550 relaying mail to privacy.net is not allowed

Thus using it violates Internet/NetNews standards (RFCs 1036
and 2822). Even if it would receive mail, the automated
response described on the website would still disregard
Usenet Netiquette. So people using privacy.net addresses
are automatically killfiled by me from now on.
See [en] <http://www.interhack.net/pubs/munging-harmful/>
and/or [de] <http://gerlo.de/falsche-email-adressen.html>
for details.

P.P.S.: de.comp.lang.javascript exists.
Jul 23 '05 #2
> RTFM. There are two ways:

Sorry, I don't have TFM. Where do I get it?
A) Move each "div" element. Obtain the collection of elements with
document.getElementsByTagName() (W3C), document.all() (IE4+) or
document.layers (NN4), then test against the className property
of each element object.
Er... OK. I think I understand.
B) Change the value of the left property in the class selector
(not in NS4 and Opera). Obtain the list of stylesheets for
the document with document.styleSheets and the rules with
the document.styleSheets[...].cssRules (Gecko) or the
document.styleSheets[...].rules (IE) collection.
That's not X-browser compatible, right?
(I want to put this in a window.onresize event handler)


Oh my. Use a proper stylesheet instead. What if client-side script
support is restricted or disabled or the DOM does not support that

at all? Thought about the user's system resources?
The onresize is triggered quite often, huh? Can you give me a link to
this approach you suggested? I'm a complete idiot when it comes to
JavaScript.
Me@privacy.net is not a mailbox address ("A mailbox receives mail"):


Sorry, It's for spam-reasons. Don't mail, post here.
-Geront
Jul 23 '05 #3

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

Similar topics

2
by: David Winter | last post by:
This is a totally trivial CSS problem, I'm sure, but I don't get it. I want a centered DIV with a fixed width between two other DIVs that should fill the rest of the window/viewport (= 100%). How...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
3
by: Marc | last post by:
Hi to all, I have several DIVs in a page, each has a unique name. I'd need a method to cycle through all DIVs so that I can change their style. For example, let's say I need to set a red...
39
by: WindAndWaves | last post by:
Hi Gurus I have a page, which looks a bit like this: .... <body> <div ID=id1>................</DIV> <div ID=gsd>................</DIV> <div ID=ewd>................</DIV> <div...
12
by: meltedown | last post by:
I would like the floating divs to float and then the header to come after them , on the left. That's what I thought clearing the floats was for, but in this example, the header is to the right of...
12
by: Kevin Blount | last post by:
I'm playing with dragable <DIV>s, being inspired by google.com/ig, where you can move items on the page around and have items you move over change position if necessary. I have 3 div's setup,...
2
by: tasman.hayes | last post by:
I'm experimenting with converting a site from a table layout to CSS. I'm floating three DIVs in a row for the top of a website (a logo, navigation buttons and a email list signup box). The DIVs...
6
by: toby | last post by:
Hi there, can anyone help please? I have a calendar view made up of div tags for each day. I can highlight a number of days in a column by clicking on one and holding down shift and clicking on...
2
by: gimme_this_gimme_that | last post by:
Suppose I have: <div id="d1"> asdfas </div> <div id="d2"> asdfasf asdf </div>
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.