|
Posted by BootNic on 04/10/07 02:21
> dorayme <doraymeRidThis@optusnet.com.au> wrote:
> news: doraymeRidThis-33B32F.11091310042007@news-vip.optusnet.com.au
> In article
> <LeBSh.19934$PL.8671@newsread4.news.pas.earthlink.net>,
> "BootNic" <bootnic@bounce.earthlink.net> wrote:
>
>> Opps. That was my error, according to browserShots the JS did not
>> fire in Safari, I can tell because the text was black, I was
>> expecting it to be red.
>>
>> BrowserShots does not have iCab, but I would guess it was the same
>> thing.
>
> In Safari it simply does not centre, the text is black. In iCab
> now it is centering, the text is blue.
Fixed the issue I think.
[url]
http://home.earthlink.net/~bootnic/JavascriptCenterFloatIV.html
[/url]
> Apart from what was happening on Jonathan's Win2000 box, do you
> see anything to suggest that:
IE fires the function more then once each time it's called, IE 6 2 or 3 time
IE 7 seems to be always 2 times.
The original script looked up the left and right margin and padding on
two elements each and ever time the script was fired. Looked up the
first div in #wrapper. Perhaps a few others that I can't recall at the
moment.
The latest version only looks them up the first time, and saves them in
a variable.
The original version would fire as many times as the browser called it,
for IE this could be a real problem, which I think is the issue, along with
all that looking up it had to do.
The latest version now calls a different function that sets a timeout. If
the function is called again before the time is up, it just resets the timeout
and saves a function call.
Added a document width check, checks the width since the last time
the function was called, if the width has not changed then it does not
call the function, no need to call it if only the height has changed.
All of these fixes, I would hope, increase the performance of the
script, and reduce the load on the browser.
I just hope I fixed a few things and not created more issues.
> either:
>
> http://tinyurl.com/2a434t
>
> or:
>
> http://tinyurl.com/2qfy35
>
> were not good?
No, they appear to be fine on my system.
In-fact I was able to simply replace the js link with the new version and
worked just fine as well. No page edit at all except the js link.
[url]
http://home.earthlink.net/~bootnic/bsIV.js
[/url]
--
BootNic Monday, April 09, 2007 10:20 PM
Don't worry about people stealing an idea. If it's original, you will
have to ram it down their throats.
*Howard Aiken*
[Back to original message]
|