Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Positioning in IE


  • From: trojani2000 at hotmail.com (Troy III Ajnej)
  • Subject: [Javascript] Positioning in IE
  • Date: Tue Jul 27 09:34:34 2004


The call: document.all
is never to be used inside a loop, it will sllow the script from few to 
hundred and thousand times, depending on how complex the page is (the number 
of doc objects contained) every time you call  document.all it iterates all 
the objects. Than if you state get element by ID it scrolls again through 
all the elements containing id, than, it has to compare if one of them yelds 
true to give the permission to ecxecute, if after this you have given f.i. 
pixelLeft than it has to do some math to decide where to put the element, 
but if you instruct posLeft, there is no math it assumes zero at left and 
simply adds the new value. Try some of variants you know that will move the 
object from left to right pixel by pixel in some old computer and see for 
your self.
I use integer +px string with posLeft or Right/\ Top when increasingly 
possitioning the object.
If I recall correctly, when stating pixelLeft, the browser looks up previous 
state than adds positive or negative value to the existing one. And this 
means more processing. (but of course, with the P4 2.66 or 3.2 GHz you will 
hardly notice the difference.)




>From: "Matt Barton" <javascript@xxxxxxxxxxxxxx>
>Reply-To: "[JavaScript List]" <javascript@xxxxxxxxxx>
>To: "[JavaScript List]" <javascript@xxxxxxxxxx>
>Subject: Re: [Javascript] Positioning in IE
>Date: Tue, 27 Jul 2004 09:15:21 +0100
>
>----- Original Message -----
>From: "Troy III Ajnej" <trojani2000@xxxxxxxxxxx>
> >
> >                   glava.style.posLeft="500px"
> >
> > Is the fastest coding syntax for dynamical positioning. Specially when
> > moving objects pixel by pixel.
> > Feel free to ask Why, Hakan.
>
>Morning,
>
>Just wondering what the explanation behind this is: I've a few pieces of
>code in my intranet app which use dynamic positioning, moving objects pixel
>by pixel, so anything that could help me understand how to do this more
>efficiently would be more than welcome.
>
>In anticipation,
>Matt.
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail