Is it possible to get current mouse cursor size in JavascriptjQuery? - Stack Overflow

I am using a custom cursor (SVG file) which is activated when hovering a button. I want this cursor to

I am using a custom cursor (SVG file) which is activated when hovering a button. I want this cursor to have the same size with default cursor on all platforms.

I wonder if it is possible to get default cursor size and set size of custom cursor accordingly.

A similar question was asked here almost 8 years ago. I was hoping it would be possible with new technologies.

I am using a custom cursor (SVG file) which is activated when hovering a button. I want this cursor to have the same size with default cursor on all platforms.

I wonder if it is possible to get default cursor size and set size of custom cursor accordingly.

A similar question was asked here almost 8 years ago. I was hoping it would be possible with new technologies.

Share Improve this question edited May 23, 2017 at 11:46 CommunityBot 11 silver badge asked Mar 30, 2017 at 21:22 user3140972user3140972 1,0657 silver badges13 bronze badges 3
  • 4 Possible duplicate of Get size of mouse cursor in javascript – jakeehoffmann Commented Mar 30, 2017 at 21:25
  • @jakeehoffmann It was asked 8 years ago. I thought there might be a solution after 8 years. – user3140972 Commented Mar 30, 2017 at 21:31
  • If you know that your question is a duplicate, and you are asking in hopes of new technology, please link back to the duplicate and explain your reasoning for the duplicate. See meta.stackoverflow./q/258363/215552. – Heretic Monkey Commented Mar 30, 2017 at 21:38
Add a ment  | 

2 Answers 2

Reset to default 4

There is no method or API of getting the size of the cursor on a user's OS. However, if you're adding a custom cursor, it is remended you set its size to 32x32 as that is the size that is most patible across most OS's.

Unfortunately, there is no property to adjust cursor size with jquery. However since you are using a custom image you might find this useful:

http://www.ajaxblender./howto-create-custom-image-cursors.html.

This will show you how to create a custom cursor without a .cur file and add some css to adjust the size.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745370080a4624756.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信