cursor type

O

olimoli

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=cursortype;
element.style.background=colorval;
}

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
 
M

McKirahan

olimoli said:
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=cursortype;
element.style.background=colorval;
}

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


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';
}
 
D

DU

McKirahan said:
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';
}


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

DU
 
K

Keith Bowes

olimoli said:
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=cursortype;
element.style.background=colorval;
}

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?

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top