change mouse cursor when hovering element

48 views
Skip to first unread message

Paul van Hoven

unread,
Mar 24, 2012, 7:03:25 PM3/24/12
to Google Web Toolkit
I want to change the mouse cursor appearance when hovering a custom
widget on the webpage such that the underlying widget appears to the
user as a link. The widget looks like this

public class GalleryFrame extends AbsolutePanel implements
HasMouseDownHandlers {

public GalleryFrame( String imagePath ) {
this.setStylePrimaryName("GalleryFrame");
...

The css style "GalleryFrame" looks like this

.GalleryFrame { width:170px;height:108px;cursor:hand; }

So, as you might guess right I want to make the whole GalleryFrame
widget clickable. Therefore, I implement the MouseDownHandler. Okay
but when hovering with the mouse over the widget nothing changes, the
cursor remains normal.

I googled around and I only find sources where they say you should add
cursor:hand to you css, as I do now in my case. But that does not
work.

What am I doing wrong here?

Jens

unread,
Mar 24, 2012, 8:43:03 PM3/24/12
to google-we...@googlegroups.com
You have to use "cursor:pointer;" in your CSS.

"cursor:hand;" was Microsoft's way of implementing "cursor:pointer" in IE5.5 and earlier versions.

-- J.
Reply all
Reply to author
Forward
0 new messages