Closed Thread Icon

Preserved Topic: Changing the mouse pointer in JS ??? Pages that link to <a href="https://ozoneasylum.com/backlink?for=18312" title="Pages that link to Preserved Topic: Changing the mouse pointer in JS ???" rel="nofollow" >Preserved Topic: Changing the mouse pointer in JS ???\

 
Author Thread
Frappuccino
Bipolar (III) Inmate

From: Paris, France
Insane since: Dec 2001

posted posted 01-06-2002 12:25

Hi,

For various reasons, some images in my website link to a page, but instead of HTML linkage, it is with JavaScript. Now, my problem is that the pointer of the mouse does not turn into a hand when hovering above the image, so the user does not understand there is a link under that...
I have bought various books to learn JavaScript, yet I don't find any answer for this issue.

Could someone please tell me what to add to my scripts please ?

Here is what I do (simplified, because there are other functions...) in my pages :

< SCRIPT LANGUAGE="JavaScript" >
function hopto(dest_url) {
parent.mainpage.location.href = dest_url;
}
< /SCRIPT >

< img src=this_image.jpg onClick=hopto("this_page.html") >

And so I'd like that the arrow turn into a hand when above "this_image" (for example)

Thanx


---
Frap'

Synthetic
Paranoid (IV) Inmate

From: under your rug,
Insane since: Jul 2001

posted posted 01-06-2002 14:46

Notice the style tag,

<SCRIPT LANGUAGE="JavaScript">
function hopto(dest_url) {
parent.mainpage.location.href = dest_url;
}
</SCRIPT>

<img src=this_image.jpg style="cursor:hand" onClick=hopto("this_page.html")>

[This message has been edited by Synthetic (edited 01-06-2002).]

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 01-06-2002 16:47

And since it's only IE who understands "cursor: hand;" you should add "cursor: pointer;" and everything's just fine in Netscape, too.

/*edit: I just tried "cursor: pointer;" in IE - my IE 6 understands it as well, but maybe you want to keep the hand thing for older IEs. */

Have fun!
Tilo



[This message has been edited by kuckus (edited 01-06-2002).]

AusRA
Paranoid (IV) Inmate

From: Ausra Island
Insane since: Nov 2001

posted posted 01-06-2002 17:24

Yeah "cursor:hand" is for IE 4x and above....

and there are several sytle tags for the pointer you can use, but they only work on IE
here's a link

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 01-06-2002 17:57

And here are the different cursors which may replace the "pointer": http://www.w3.org/TR/REC-CSS2/ui.html

Have fun!
Tilo



Frappuccino
Bipolar (III) Inmate

From: Paris, France
Insane since: Dec 2001

posted posted 01-06-2002 20:05

Thanks a lot !!!



[This message has been edited by Frappuccino (edited 01-06-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu