Reply to Re: Update to my old 3 column layout template

Your name:

Reply:


Posted by BootNic on 01/06/08 16:14

Toby A Inkster <usenet200712@tobyinkster.co.uk> wrote in
news:ohi555-vbq.ln1@ophelia.g5n.co.uk:

> BootNic wrote:
>
>> Have a look at this script. Give it a go and see how it works for
>> you.
>
> I'll give it a whirl, but at first glance it looks a little over-
> complicated. From what I can tell, your stability fix is to prevent
> the column resize function from being dispatched several times
> simultaneously or near-simultaneously.

That would be the most important to limit how many times the columns are
resized. It also prevents the columns from being resize if the
documentElement offset Height/Width has not changed.

The main issue is that some browsers fire multiple resize events on one
resizing of the UA.

IE and Opera, if I not mistaken, always fire twice for one resize. That
in its self is not a big issue for just a maximize/restore situation. It
does become an issue when the UA is resized with the mouse, depending on
the speed of the UA resize, it could be something like 50 or more resize
events being fired within a few milliseconds.

I have created a simple example that counts resize events that can be
played with.

Although this example does not do much when a resize event is fired, it
may still be possible to lock up IE.

[url] http://tinyurl.com/yujuf4 [/url]
[url] http://preview.tinyurl.com/yujuf4 [/url]

> The font size check is a good idea.
>
>> It's self contained, no need for that bit of script after the closing
>> body tag.
>
> The decision to make my script not self-contained was deliberate. It
> avoids hard-coding the element IDs into the javascript file. It also
> allows the functions to fire prior to window.onload.

The IDs can still be in a separate js file, right off I would suggest an
addition of a global array to hold the ID's and loop through them in
place of setting them in the onload function.

js file for ID's :
var IDs = ['left', 'right', 'main'];

then in colStack change the following:

colStack[0] = document.getElementById('left');
colStack[1] = document.getElementById('right');
colStack[2] = document.getElementById('main');

to:
for (var e=0; e<IDs.length; e++) {
colStack.push(document.getElementById(IDs[e]));
/* If for some reason you would like to avoid the array.push
colStack[e] = document.getElementById(IDs[e])
*/
}

As for the firing before the onload event, I would really be surprised if
the time saved for the effort in this example would exceed 100
milliseconds.

--
BootNic Sunday January 6, 2008 11:14 AM
"No man's life, liberty, or property is safe while the legislature
is in session."
*Judge Gideon J. Tucker, 1866.*

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация