Forum Moderators: open

Message Too Old, No Replies

turn cursor into magnefying lens?

         

ktsirig

12:39 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



Hello,
I was wondering if there are any scripts available which will help me transform the mouse cursor into a magnefying lens once it hovers over an image. I think that onmouse.hover will be what I need, but what about the image of the lens? Are there any images like this ready?

Thank you!

Little_G

1:07 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



Hi,

For Mozilla browsers only you can use CSS

cursor: -moz-zoom-in;
and
cursor: -moz-zoom-out;

Some browsers also support setting the cursor to an external file, see here [w3.org]

Andrew

penders

6:33 pm on Oct 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I guess it's possible, that in the onmouseover event of the element, you display, an otherwise hidden, absolutely positioned img at the cursor position and have it follow the mouse cursor around (can you hide the mouse cursor?!) - you can then use any image you like?

LoPoBo

12:12 am on Oct 30, 2006 (gmt 0)

10+ Year Member



You can use cursor: url(lens.cur); in CSS to change the cursor.

I tried to use this to make it change when hovering over an image, but for some reason it only worked the first time. But maybe you can edit the code.

<image onMouseOver="javascript:body.style.cursor = 'url(lens.cur)';" onMouseOut="javascript:body.style.cursor = 'default';" src="image.jpg">