Edge customize cursor doesn't work

前端 未结 1 478
执念已碎
执念已碎 2021-01-16 09:23

Below is my code, cursor1.cur icon is under the same root folder as index.html. The cur icon can be downloaded from this link: http://samples.msdn.microsoft.com/workshop/sam

1条回答
  •  一个人的身影
    2021-01-16 09:56

    I know I am late to the party, but there is another option for Edge that I have come across. Only .cur files will work in Edge for setting a custom cursor. You can use a URL to a .cur file or the path in your project to a local resource. But be sure to not put any numbers between end parens and the auto keyword. My use case was changing the cursor for fabric js annotations. The important part is to not put anything between the end parens and the auto keyword or else Edge will ignore the cursor change. Chrome and Firefox of course have no problem with this.
    So I check if it is Edge then I use freeDrawingCursor = 'url(http://cur.cursors-4u.net/others/oth-7/oth697.cur),auto'; and if it is a different browser I can specify numbers such as freeDrawingCursor = 'url(http://cur.cursors-4u.net/others/oth-7/oth697.cur) 0 34,auto'; Most answers you see online will show numbers being used so be aware of what browser your user is on.

    0 讨论(0)
提交回复
热议问题