Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Moving DIVs?

Reply
Thread Tools

Moving DIVs?

 
 
Gernot Frisch
Guest
Posts: n/a
 
      04-22-2004

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:
http://www.velocityreviews.com/forums/(E-Mail Removed)
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com


 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-03-2004
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.:
(E-Mail Removed) is not a mailbox address ("A mailbox receives mail"):

| (E-Mail Removed)
| SMTP error from remote mailer after RCPT TO:<(E-Mail Removed)>:
| 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.
 
Reply With Quote
 
 
 
 
Gernot Frisch
Guest
Posts: n/a
 
      05-03-2004
> 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.

> (E-Mail Removed) is not a mailbox address ("A mailbox receives mail"):


Sorry, It's for spam-reasons. Don't mail, post here.
-Geront


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Guide Moving Companies Movers Storage linkswanted ASP .Net 0 01-23-2008 01:08 AM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
Moving to California Moving to L.A linkswanted Digital Photography 3 01-05-2008 04:22 PM
movers los angeles moving storage services movers in L.A companymoving companies moving in calfornia los angeles linkswanted HTML 0 12-21-2007 10:55 PM



Advertisments