FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » Newbie: speed issue?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Newbie: speed issue? [message #16675 is a reply to message #16518] Wed, 11 February 2004 22:24 Go to previous messageGo to previous message
Darknean is currently offline  Darknean   Canada
Messages: 1
Registered: February 2004
Karma:
Junior Member
I had problem once with javascript where a looping was preventing IE to continue normally. Javascript waits 'til the loop 'for' is done. Maybe in this case it would be more adequat to use setTimeout instead.

EDIT
=====================================================
Ok! I tried some alternatives and here what my png part in lib.js looks like:
Quote:


// This code below is used to make PNG's to work in IE.
// The code comes from youngpup.net. Thanks youngpup!
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

if (itsAllGood) {
// EDIT: Commented by Sébastien Nadon
// February 11, 2004
//document.writeln('<style type="text/css">img { visibility:hidden; } </style>');
window.attachEvent("onload", fnLoadPngs);
}
}

//==================================================
// EDITED BY Sébastien Nadon
// February 11, 2004
//--------------------------------------------------
// Using 'while' instead of 'for' to better
// avoid the temporary inactivity of IE
//==================================================
function fnLoadPngs()
{
var i = document.images.length;

while( img = document.images[ --i ] )
{
if( img.src.match(/\.png$/i) != null )
{
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "', sizingMethod='image')";
img.src = "blank.gif";
}
}
}

/* Test with setTimeout
** Error: Object Expected
function fnLoadPngs()
{
fnLoadPngsSmoothly( document.images.length -1 );
}

function fnLoadPngsSmoothly( i )
{
if( img = document.images[ i ] )
{
if( img.src.match(/\.png$/i) != null )
{
var src = img.src;
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='image')";
img.src = "blank.gif";
}

setTimeout( "fnLoadPngsSmoothly( --i );", 30 );
}
}
*/



I hope Ilia can check this because I'm running out of time Sad

[Updated on: Wed, 11 February 2004 22:58]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Previous Topic: NNTP script wasn't updated with 2.6.1
Next Topic: Changelog
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 17:21:06 GMT 2024

Total time taken to generate the page: 0.04482 seconds