Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > cursor type

Reply
Thread Tools

cursor type

 
 
olimoli
Guest
Posts: n/a
 
      01-06-2004
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
 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      01-06-2004
"olimoli" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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';
}


 
Reply With Quote
 
 
 
 
DU
Guest
Posts: n/a
 
      01-06-2004
McKirahan wrote:
> "olimoli" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
>
>>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';
> }
>
>



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

DU
 
Reply With Quote
 
Keith Bowes
Guest
Posts: n/a
 
      01-06-2004
olimoli wrote:
> 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').

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
mysqldb cursor returning type along with result ? Paul O'Sullivan Python 2 11-29-2009 03:57 PM
Declare Cursor error while implementing SCROLL CURSOR invy C Programming 4 12-28-2006 02:35 PM
Command Object, Parameters, Set Cursor Type. etc? +Bob+ ASP General 4 11-29-2006 05:51 PM
Changing DEFAULT cursor to WAIT cursor in ASP =?Utf-8?B?VG9tYXMgS2VwaWM=?= ASP .Net 1 04-05-2005 07:42 PM



Advertisments