style.cursor on IE

Discussion in 'Javascript' started by datvong@gmail.com, Oct 27, 2008.

  1. Guest

    IE does not change the cursor immediately after a style.cursor is
    set. In the following sample, I have 2 divs, one inside another. The
    inner has a cursor of crosshair, outer a hand.
    If I click on the inner div, causing it to disappear, the mouse would
    be over the outer div, but the cursor is still a crosshair. The
    cursor will change to the correct cursor when I move the mouse.

    <div style='cursor:hand;width:300;height:300'>
    <div id='inner' style='cursor:crosshair;width:300;height:50'
    onclick="this.style.display='none'">
    Click to make this div disappear
    </div>
    </div>


    Is there any way to force the cursor to change? On work-around is
    doing a resizeBy(-1,0); resizeBy(1,0), but that is impractical for my
    application.


    Thansk,
    Dat.
     
    , Oct 27, 2008
    #1
    1. Advertising

  2. Guest

    On Oct 27, 3:45 pm, "" <> wrote:
    > IE does not change the cursor immediately after a style.cursor is
    > set.  In the following sample, I have 2 divs, one inside another.  The
    > inner has a cursor of crosshair, outer a hand.
    > If I click on the inner div, causing it to disappear, the mouse would
    > be over the outer div, but the cursor is still a crosshair.  The
    > cursor will change to the correct cursor when I move the mouse.
    >
    > <div style='cursor:hand;width:300;height:300'>
    >    <div id='inner' style='cursor:crosshair;width:300;height:50'
    > onclick="this.style.display='none'">
    >     Click to make this div disappear
    >    </div>
    > </div>
    >
    > Is there any way to force the cursor to change?  On work-around is
    > doing a resizeBy(-1,0); resizeBy(1,0), but that is impractical for my
    > application.
    >
    > Thansk,
    > Dat.


    resizeBy also does not work if there are multiple tabs in IE.
    and an access exception occurs if the mouse is down.
     
    , Oct 28, 2008
    #2
    1. Advertising

  3. David Mark Guest

    On Oct 27, 6:45 pm, "" <> wrote:
    > IE does not change the cursor immediately after a style.cursor is
    > set.  In the following sample, I have 2 divs, one inside another.  The
    > inner has a cursor of crosshair, outer a hand.
    > If I click on the inner div, causing it to disappear, the mouse would
    > be over the outer div, but the cursor is still a crosshair.  The
    > cursor will change to the correct cursor when I move the mouse.
    >
    > <div style='cursor:hand;width:300;height:300'>


    The "hand" style is not standard. Use it only as a fallback for
    "pointer." And 300 what?

    >    <div id='inner' style='cursor:crosshair;width:300;height:50'
    > onclick="this.style.display='none'">
    >     Click to make this div disappear
    >    </div>
    > </div>
    >
    > Is there any way to force the cursor to change?  On work-around is


    Only hacks. I wouldn't worry about it.

    > doing a resizeBy(-1,0); resizeBy(1,0), but that is impractical for my
    > application.


    Or any application.
     
    David Mark, Oct 28, 2008
    #3
  4. Guest

    Donale Anadell wrote this in the microsoft.internetexplorer forum...


    >> You might try making the following change to your "onclick" event:
    >>
    >> onclick="this.style.display='none';this.style.cursor='hand'">
    >>
    >> Good luck,
    >>
    >> Donald Anadell



    I tried it and it inexplicably works!


    On Oct 28, 1:49 pm, "" <> wrote:
    > On Oct 27, 3:45 pm, "" <> wrote:
    >
    >
    >
    > > IE does not change the cursor immediately after a style.cursor is
    > > set.  In the following sample, I have 2 divs, one inside another.  The
    > > inner has a cursor of crosshair, outer a hand.
    > > If I click on the inner div, causing it to disappear, the mouse would
    > > be over the outer div, but the cursor is still a crosshair.  The
    > > cursor will change to the correct cursor when I move the mouse.

    >
    > > <div style='cursor:hand;width:300;height:300'>
    > >    <div id='inner' style='cursor:crosshair;width:300;height:50'
    > > onclick="this.style.display='none'">
    > >     Click to make this div disappear
    > >    </div>
    > > </div>

    >
    > > Is there any way to force the cursor to change?  On work-around is
    > > doing a resizeBy(-1,0); resizeBy(1,0), but that is impractical for my
    > > application.

    >
    > > Thansk,
    > > Dat.

    >
    > resizeBy also does not work if there are multiple tabs in IE.
    > and an access exception occurs if the mouse is down.
     
    , Oct 28, 2008
    #4
  5. David Mark Guest

    On Oct 28, 7:17 pm, "" <> wrote:
    > Donale Anadell wrote this in the microsoft.internetexplorer forum...
    >
    > >> You might try making the following change to your "onclick" event:

    >
    > >> onclick="this.style.display='none';this.style.cursor='hand'">

    >
    > >> Good luck,

    >
    > >> Donald Anadell

    >
    > I tried it and it inexplicably works!
    >


    It isn't hard to explain at all if you think about it. IE was
    momentarily showing the cursor for the wrong element. You changed
    that cursor. Unfortunately, you changed it to "hand."
     
    David Mark, Oct 29, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VG9tYXMgS2VwaWM=?=

    Changing DEFAULT cursor to WAIT cursor in ASP

    =?Utf-8?B?VG9tYXMgS2VwaWM=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,329
    Bruce Barker
    Apr 5, 2005
  2. invy
    Replies:
    4
    Views:
    395
    CBFalconer
    Dec 28, 2006
  3. Replies:
    1
    Views:
    492
    bruce barker
    Apr 3, 2007
  4. dmaziuk
    Replies:
    3
    Views:
    587
    Chris Gonnerman
    Jan 25, 2011
  5. Ken Varn
    Replies:
    0
    Views:
    479
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page