mouse cursor problem !!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brami Yair

    mouse cursor problem !!

    Hi,

    below is example js:

    function SomeLongProcess ()
    {
    for(var i=0;i<document. all.length;i++)
    document.all(i) .style.cursor=" wait";

    // some long process here !!

    for(var i=0;i<document. all.length;i++)
    document.all(i) .style.cursor=" default";
    }

    so, the problem is, that the mouse cursor not change, until i focus to
    different window, and return to this window.

    thanks,
  • Evertjan.

    #2
    Re: mouse cursor problem !!

    Brami Yair wrote on 08 jul 2004 in comp.lang.javas cript:
    [color=blue]
    > below is example js:
    >
    > function SomeLongProcess ()
    > {
    > for(var i=0;i<document. all.length;i++)
    > document.all(i) .style.cursor=" wait";
    >
    > // some long process here !!
    >
    > for(var i=0;i<document. all.length;i++)
    > document.all(i) .style.cursor=" default";
    >}
    >
    > so, the problem is, that the mouse cursor not change, until i focus to
    > different window, and return to this window.[/color]

    try asyngronous code:

    function myWait(){
    for(var i=0;i<document. all.length;i++)
    document.all(i) .style.cursor=" wait";
    }

    function myDefault(){
    for(var i=0;i<document. all.length;i++)
    document.all(i) .style.cursor=" default";
    }


    function SomeLongProcess (){
    setTimeout('myW ait()'),50)
    // some long process here !!
    setTimeout('myD efault()'),50)
    }

    not tested, btw.

    ==========

    Why not:

    function myWait(){
    document.body.s tyle.cursor="wa it";
    }

    function myDefault(){
    document.body.s tyle.cursor="de fault";
    }


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    Working...