cursor type

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

    cursor type

    Hi,

    I have a problem changing the cursor type with javascript. I have a
    button with an mouseover effect (change of color and cursor type). It
    works fine in Netscape 7.x and IE 6.x but not in IE 5.5 I'm using the
    following script:

    function change(element, mode) {
    if (mode=="in") {
    cursortype = 'pointer'
    colorval = '#FF491B'
    } else if (mode=="out") {
    cursortype = ''
    colorval = '#F47240'
    }
    element.style.c ursor=cursortyp e;
    element.style.b ackground=color val;
    }

    The error I'm getting with IE 5.5 is "cursor type not defined..." or
    something but the pointer is supposed to work even with IE 4.x

    Does anybody has a solution for this problem?
    Thanks!
    Cheers Olaf
  • McKirahan

    #2
    Re: cursor type

    "olimoli" <ohaupt@web.d e> wrote in message
    news:958861ea.0 401060213.768e6 176@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I have a problem changing the cursor type with javascript. I have a
    > button with an mouseover effect (change of color and cursor type). It
    > works fine in Netscape 7.x and IE 6.x but not in IE 5.5 I'm using the
    > following script:
    >
    > function change(element, mode) {
    > if (mode=="in") {
    > cursortype = 'pointer'
    > colorval = '#FF491B'
    > } else if (mode=="out") {
    > cursortype = ''
    > colorval = '#F47240'
    > }
    > element.style.c ursor=cursortyp e;
    > element.style.b ackground=color val;
    > }
    >
    > The error I'm getting with IE 5.5 is "cursor type not defined..." or
    > something but the pointer is supposed to work even with IE 4.x
    >
    > Does anybody has a solution for this problem?
    > Thanks!
    > Cheers Olaf[/color]


    If "mode" is neither "in" or "out" then "cursortype " will not be defined.

    You might want to use this snippet:

    if (mode=="in") {
    cursortype = 'pointer';
    colorval = '#FF491B';
    } else {
    cursortype = '';
    colorval = '#F47240';
    }


    Comment

    • DU

      #3
      Re: cursor type

      McKirahan wrote:[color=blue]
      > "olimoli" <ohaupt@web.d e> wrote in message
      > news:958861ea.0 401060213.768e6 176@posting.goo gle.com...
      >[color=green]
      >>Hi,
      >>
      >>I have a problem changing the cursor type with javascript. I have a
      >>button with an mouseover effect (change of color and cursor type). It
      >>works fine in Netscape 7.x and IE 6.x but not in IE 5.5 I'm using the
      >>following script:
      >>
      >>function change(element, mode) {
      >>if (mode=="in") {
      >> cursortype = 'pointer'
      >> colorval = '#FF491B'
      >>} else if (mode=="out") {
      >> cursortype = ''
      >> colorval = '#F47240'
      >>}
      >>element.style .cursor=cursort ype;
      >> element.style.b ackground=color val;
      >>}
      >>
      >>The error I'm getting with IE 5.5 is "cursor type not defined..." or
      >>something but the pointer is supposed to work even with IE 4.x
      >>
      >>Does anybody has a solution for this problem?
      >>Thanks!
      >>Cheers Olaf[/color]
      >
      >
      >
      > If "mode" is neither "in" or "out" then "cursortype " will not be defined.
      >
      > You might want to use this snippet:
      >
      > if (mode=="in") {
      > cursortype = 'pointer';
      > colorval = '#FF491B';
      > } else {
      > cursortype = '';
      > colorval = '#F47240';
      > }
      >
      >[/color]


      cursortype = "auto";
      instead of
      cursortype = '';
      is slightly better (more robust; parsing related) IMO.

      DU

      Comment

      • Keith Bowes

        #4
        Re: cursor type

        olimoli wrote:[color=blue]
        > Hi,
        >
        > I have a problem changing the cursor type with javascript. I have a
        > button with an mouseover effect (change of color and cursor type). It
        > works fine in Netscape 7.x and IE 6.x but not in IE 5.5 I'm using the
        > following script:
        >
        > function change(element, mode) {
        > if (mode=="in") {
        > cursortype = 'pointer'
        > colorval = '#FF491B'
        > } else if (mode=="out") {
        > cursortype = ''
        > colorval = '#F47240'
        > }
        > element.style.c ursor=cursortyp e;
        > element.style.b ackground=color val;
        > }
        >
        > The error I'm getting with IE 5.5 is "cursor type not defined..." or
        > something but the pointer is supposed to work even with IE 4.x
        >
        > Does anybody has a solution for this problem?[/color]

        IE 4.0 through 5.5 didn't support the cursor type 'pointer' (only the
        non-standard 'hand').

        Comment

        Working...