最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to make cursor style to circle using html or javascript - Stack Overflow

programmeradmin0浏览0评论

I'm building a drawing app, and I want a cursor in form of circle. I searched HTML5 style to make cursor default, pointer etc, but I need it to be a circle. How can I do this?

I'm building a drawing app, and I want a cursor in form of circle. I searched HTML5 style to make cursor default, pointer etc, but I need it to be a circle. How can I do this?

Share Improve this question edited Jun 28, 2015 at 16:37 John Farkerson 2,6322 gold badges26 silver badges37 bronze badges asked Jun 28, 2015 at 16:25 lekha pillailekha pillai 451 silver badge7 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

What you want can be done by CSS.

Check out the following snippet and this jsfiddle

#circle64 {
  cursor: url('http://www.iconsdownload/icons/64/16574-black-circle.png'), pointer;
}
#circle32 {
  cursor: url('http://www.iconsdownload/icons/32/16574-black-circle.png'), pointer;
}
#circle24 {
  cursor: url('http://www.iconsdownload/icons/24/16574-black-circle.png'), pointer;
}
<div id='circle64'>
  Cursor will
  <br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle32'>
  Cursor will
  <br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle24'>
  Cursor will
  <br>be</br>different here.
</div>

you can use an image as cursor, by using this css property

cursor: url(images/my-cursor.png), auto;

for example if you have some input and you want to show round cursor on it , you should use png image

input{
cursor: url(images/my-cursor.png), auto;
}

check this jsfiddle http://jsfiddle/pwy51Ly8/

From this link "It wasn't working because your image was too big - there are restrictions on the image dimensions. In Firefox, for example, the size limit is 128x128px"

You can use CSS cursor wait

div {
    cursor: wait;
}

or

div {
 cursor: url("your custom cursor image"), auto;
}
发布评论

评论列表(0)

  1. 暂无评论