admin管理员组

文章数量:1392076

I want to set icon as curse pointer in JavaScript. I try some default cursor style. See below code.

<span style="cursor:pointer">auto</span><br>

But I want to set my icon as cursor. Example:- "cursor : My Icon" .

How would i set this in CSS?

I want to set icon as curse pointer in JavaScript. I try some default cursor style. See below code.

<span style="cursor:pointer">auto</span><br>

But I want to set my icon as cursor. Example:- "cursor : My Icon" .

How would i set this in CSS?

Share Improve this question asked Feb 27, 2015 at 11:14 chiragchirag 1,8281 gold badge16 silver badges36 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

You should used cursor: url(image.png) like:

span {
   cursor: url(cursor.png), auto;
}

Try this CSS:

   span{ cursor:url('http://www.dolliehost./dolliecrave/cursors/cursors-all/animals01.gif'), auto }

FIDDLE

The other answers are correct, but if you want to do it in jquery you can do this:

$('selector').css( 'cursor', 'url(cursor.ico)' );

本文标签: javascriptSet icon as cursor pointer in CSSStack Overflow