You are here: Re: Centering « HTML « IT news, forums, messages
Re: Centering

Posted by dorayme on 04/10/07 22:17

In article
<tCQSh.20152$PL.17568@newsread4.news.pas.earthlink.net>,
"BootNic" <bootnic@bounce.earthlink.net> wrote:

> > Ben C <spamspam@spam.eggs> wrote:

> >> http://tinyurl.com/2a434t
> > I see the JS checks
> > for window.addEventListener, but not for document.addEventListener.
> > I'm not sure whether it should or not.
>
> That is not correct, that is the kind of mistake I make for trying to
> type from a memory and auto select.
>
> It should have been like Jonathan N. Littles snip and needs to be
> corrected.
>
> // attach events
> if( window.addEventListener ) {
> window.addEventListener('load',floatCenter,false); //legacy
> window.addEventListener('resize',floatCenter,false);
> } else if( document.addEventListener ) {
> document.addEventListener('load',floatCenter,false); //proper
> document.addEventListener('resize',floatCenter,false);
> } else if( window.attachEvent ) {
> window.attachEvent("onload", floatCenter); //IE only
> window.attachEvent("onresize", floatCenter);
> }
>
> Tuck this away in a code snip so next time I make this mistake I may
> be able to recognize it.

Things move fast. http://tinyurl.com/2a434t was superseded by:

http://tinyurl.com/yplj5d

in which I put in what I call bootnic4.js (the latest I had).
Are the above changes to be incorporated into this latest? And
how quite is the incorporation to go in http://tinyurl.com/yplj5d?

Should the lines:

if( window.addEventListener ) {
window.addEventListener('load',checkCenter,false);
window.addEventListener('resize',checkCenter,false);
} else if( document.addEventListener ) {
document.addEventListener('load',checkCenter,false);
document.addEventListener('resize',checkCenter,false);
} else if( window.attachEvent ) {
window.attachEvent("onload", checkCenter);
window.attachEvent("onresize", checkCenter);
}

be _replaced_ by your above?

--
dorayme

 

Navigation:

[Reply to this 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

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