Web 应用程序中的动画光标支持? [英] Animated cursor support in web applications?

查看:25
本文介绍了Web 应用程序中的动画光标支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何网络浏览器支持动画光标?

Do any web browsers support animated cursors?

我一直在网上搜索以向我的 Web 应用程序添加自定义光标.我一直在发现很多非动画 (.cur) 和动画 (.ani) 光标,并使用正确的 CSS 以便我的应用程序具有自定义光标!我尝试过的网络浏览器似乎不支持动画光标,我想知道是否有任何方法可以将动画光标放入我的网络应用程序中.

I've been searching the web to add custom cursors to my web application. I've been finding a lot of non animated (.cur) and animated (.ani) cursors, and using the correct CSS so that my application has custom cursors! It seems that the animated cursors are not supported in the web browsers I tried and I was wondering if there is any way possible to put animated cursors into my web application.

推荐答案

经过进一步研究后,我认为目前不可能.自 2012 年 2 月 8 日起,似乎没有任何浏览器使用 CSS cursor 属性支持动画光标.我想可以使用 JavaScript 每隔几帧重复更改 cursor 属性的值以使其显示动画效果,但这可能比值得的麻烦更多.

After doing some more research, I don't think it's possible at the moment. It doesn't seem that any of the browsers support animated cursors as of 2/8/2012 using the CSS cursor property. I suppose it could be done using JavaScript to repeatedly change the value of the cursor property every few frames to make it appear animated, but that may be more trouble than it is worth.

动画光标文件 .ani 文件不起作用.所有 5 种主要网络浏览器都不会显示光标.如果您尝试使用类似 cursor: url('animated.ani') 的 CSS,该光标将不会显示!

Animated cursor files .ani files do not work. All 5 major web browsers will not show the cursor. If you try some CSS like, cursor: url('animated.ani'), that cursor will not show up!

如果你将光标设为动画 gif 文件,它只会在某些浏览器上显示并且是有气质的,比如 cursor: url('animated.gif'),光标在 Firefox 和 Chrome 中有效但它没有动画,光标在 IE9 或 Opera 中根本不起作用,它在 Windows 版本的 Safari 中做了一些非常奇怪的事情 - 它起作用但只有当我在屏幕上垂直移动光标时才会动画,并且没有当光标不移动或水平移动时完全动画.感谢 Brutallus 提出使用 gif 动画的想法,即使它不起作用!

If you make the cursor an animated gif file, it only shows up on some browsers and it's temperamental, like cursor: url('animated.gif'), the cursor works in Firefox and Chrome but it is not animated, the cursor does not work at all in IE9 or Opera, and it did something really weird in the Windows version of Safari - it works but is only animated when I move the cursor vertically on the screen, and did not animate at all when the cursor was not moving or was moving horizontally. Credit to Brutallus for the idea to use an animated gif even though it did not work!

目前似乎浏览器不支持动画光标,这很遗憾,因为我真的认为它会为某些 Web 应用程序增加一些深度.我不提倡在大多数网站上使用动画光标,因为它们非常烦人,但在一些罕见的情况下它们会很有用,例如 HTML5 游戏,光标可能会添加到游戏的主题中.

It doesn't seem that browsers support animated cursors at this time which is a shame because I really think it would add some depth to certain web applications. I don't advocate using animated cursors for most websites because they are extremely annoying, but there are some rare situations where they can be useful, such as a HTML5 game where the cursor can potentially add to the theme of the game.

这篇关于Web 应用程序中的动画光标支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆