ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Using setHover

molochTop Contributor
21 Jan 2011 01:39:38 GMT
21 Jan 2011 01:39:38 GMT

Hello i want to change the mouse arrow to an little hand when i mouse over an image. setHover is not the right method.
please tell me how to do this.. i want the same that happens when i move over an button.

greets

mirkobruzzone
25 Jan 2011 04:09:40 GMT
25 Jan 2011 04:09:40 GMT

I Moloch,
You could insert - style="cursor: hand" - inside the attribute.

Regards
Mirko

molochTop Contributor
25 Jan 2011 06:01:53 GMT
25 Jan 2011 06:01:53 GMT

hi, how do you mean this?
i tried:

//does not work
img.setAttribute("style", "cursor: hand");

//does not work too
img.setSclass("styleCursorHand");

css
.styleCursorHand {
cursor: pointer;
}

valmarTop Contributor
10 Oct 2011 12:32:43 GMT
10 Oct 2011 12:32:43 GMT

Same question.

I tried this and it didn't work on Google Chrome:

img.setStyle("cursor: hand;");

twiegandTop Contributor
11 Oct 2011 16:21:22 GMT
11 Oct 2011 16:21:22 GMT

Try using pointer instead of hand.  Something like this:

img.setStyle("cursor: pointer;");

Regards,

Todd

valmarTop Contributor
11 Oct 2011 18:16:15 GMT
11 Oct 2011 18:16:15 GMT

I worked around this by using

new Toolbarbutton("", "gfx/image.png");

instead of Image.

jimmyshiau
11 Oct 2011 20:00:00 GMT
11 Oct 2011 20:00:00 GMT

I have tried the following sample, it works fine.

<image src="Animations-24x24.png" style="cursor: pointer;"></image>