我在 WebKit 浏览器中遇到了无法拉动光标的问题。令人惊讶的是 IE 和 Opera 的工作方式正如我所期望的那样。这是 CSS,
.olControlDrawFeatureActive {
cursor: url(<DOMAIN>/common/images/cursors/draw.png), crosshair, default;
}
它非常简单地将光标更改为 Draw png,或者,如果它不接受自定义光标或 PNG(如 IE 或 Opera),那么它应该默认为十字准线。在 IE 和 Opera 中工作正常,它按照我想要的方式进入十字准线,而 FireFox、Safari 和 Chrome 则拒绝为此返回任何 css。看看 Firebug 中返回的 CSS,我刚刚得到。
.olControlDrawFeatureActive {
}
空虚,完全没用。我尝试用它的完整路径和相对路径替换 URL 并且(这对我来说是最令人困惑的一点)我尝试完全删除自定义光标,因此它应该默认为十字准线,但它仍然只返回一个空的 CSS 规则!它已经困扰我一段时间了,因为它最初在 Webkit 中工作得很好,但在 IE 中却不行,让它在 IE 中工作,现在 WebKit 决定不再玩了!我是否做了一些明显错误的事情?任何帮助或指示将不胜感激,因为它让我香蕉
I am having trouble with cursors not being pulled through in WebKit browsers. Surprsingly IE and Opera work as I expect them to. Here's the CSS
.olControlDrawFeatureActive {
cursor: url(<DOMAIN>/common/images/cursors/draw.png), crosshair, default;
}
It quite simply changes the cursor to either the Draw png or, if it doesn't accept custom cursors or PNGs (like IE or Opera) then it should default to the crosshair. Works fine in IE and Opera, it goes to the crosshair as I want it to, FireFox, Safari and Chrome on the other hand refuse to return any css for this at all. Looking at the returned CSS in Firebug I just get.
.olControlDrawFeatureActive {
}
Empty, and utterly useless. I have tried replacing the URL with it's full path and relative path and (and this is the most confusing bit for me) I have tried removing the custom cursor entirely so it should default to the crosshair, but still it just returns an empty CSS rule! It's been bugging me for a while now because it originally worked fine in Webkit but not in IE, got it working in IE and now WebKit decides to not play ball! Am I doing something really obvious wrong? Any help or pointers would be hugely appreciated as it is driving me bananas 
发布评论
评论(1)
问题似乎在于我指定了 3 个级别的光标,即自定义光标、十字准线和默认光标。无论如何,没有必要在那里设置默认的十字准线,因为所有浏览器都接受十字准线。删除这个似乎可以让它发挥作用。
这看起来很奇怪,CSS 只允许两级光标吗?如果是这样,那么为什么 Opera 和 IE 接受它,他们只是忽略第一个?
固定CSS
The problem seemed to lay in the fact that I had specified 3 levels of cursors i.e. The Custom one, the Crosshair and the Default cursor. There was no need to have the default one in there anyway as Crosshair is accepted by all browsers. Removing this seemed to make it work.
This seems strange though, does CSS only allow for two levels of cursors? If so then why did Opera and IE accept it, do they just ignore the first one?
Fixed CSS