On Thursday, November 09, 2006 1:49 PM Jörn Zaefferer <> said:

> Just the complete application. It's way to much stuff to look through
> all of it to find the problem you mentioned. I'm willing to help, but
> please understand that you can help, too :-)

Although I haven't removed anything (well, I've commented several things) I've 
narrowed it down to the setTimeout() function in .ajaxStart(). It would be 
great if you could look at that code block and tell me if you see anything 
fishy.

Here is the original code block (comments removed):

$("#loading")
        .ajaxStart(function(){
                loadingWidth = (document.body.clientWidth + 16) + 'px';

                $("#loading").css({width: loadingWidth});

                timeoutId = window.setTimeout(function () {
                        $("#loading").slideDown("fast");
                }, 1000);
        })
        .ajaxStop(function(){
                window.clearTimeout(timeoutId);

                if(document.getElementById("loading").style.display != "none")
                { 
                        $("#loading").slideUp("fast");
                }
        });

With it as above it does not work correctly. It also appears to be the cause of 
the problem that I can't do $('a.className') but have to do $('.className'). 
(Notice that missing 'a'.)

If I make the following adjustments to that code block everything works fine:

$("#loading")
        .ajaxStart(function(){
                loadingWidth = (document.body.clientWidth + 16) + 'px';
                $("#loading").css({width: loadingWidth});

//              timeoutId = window.setTimeout(function () {
                        $("#loading").slideDown("fast");
//              }, 1000);
        })
        .ajaxStop(function(){
//              window.clearTimeout(timeoutId);

                if(document.getElementById("loading").style.display != "none")
                { 
                        $("#loading").slideUp("fast");
                }
        });

Do you see any reason why those three lines would be causing this problem?



Thanks,
Chris.

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to