sazr
sazr

Reputation: 25928

CSS Cursor: Can it be a semi-transparent image

I am trying to create an effect when you place the mouse cursor over an img it glows in the small region where the mouse is.

I acheive this by changing the cursor to a .gif when its over the img. I have used the CSS cursor attribute for the img, but the cursor image(a .gif I made in photoshop) is flat when it is supposed to be transparent.

Is it possible to have a semi transparent cursor in HTML/CSS? Maybe I need to use a .cur file or maybe .ico?

Should I just hook the onmouseover event & place an img(with the transparent glow look) under the mouse as it moves?

Upvotes: 1

Views: 1466

Answers (2)

Gabe
Gabe

Reputation: 50493

You could create your own custom cursor.

Then apply this style:

.customCursor {
   cursor: url('mycursor.cur');
}

Upvotes: -1

Ry-
Ry-

Reputation: 224963

You could do the alternative if you need the image to be animated, but using a 32-bit PNG instead (which you should prefer over GIF regardless ;)) should work.

Upvotes: 2

Related Questions