【问题标题】:Changing cursor style in Chrome fails when user is hovering over a link当用户将鼠标悬停在链接上时,更改 Chrome 中的光标样式失败
【发布时间】:2011-05-18 15:06:24
【问题描述】:

我在 Chrome 中看到了一个奇怪的问题。

当单击侧边栏链接时,我使用 ajax 回调将光标的 css 样式设置为“等待”。这在 Firefox 中完美运行,但在 Chrome 上,光标样式仅在我将鼠标悬停在链接之外时才会更改 - 即当用户仍将鼠标悬停在链接上时样式不会更改

我做错了什么?以下是相关代码:

// beforeSend callback
$('.ajax-link').bind('ajax:beforeSend', function() {
  $('body').css('cursor', 'wait');
  $('a').css('cursor', 'wait');  
  $('article.post').addClass('loading');    
});

// success callback    
$('.ajax-link').bind('ajax:success', function() {
  $('body').css('cursor', 'default');
  $('a').css('cursor', 'pointer');  
  $("article.post").html("<%= escape_javascript(render @post) %>");
});

如您所见,我也使用$('a').css('cursor', 'wait'); 明确设置所有锚点的 css,以便它在 Firefox 中工作,但 Chrome 似乎没有注意到这一点。

【问题讨论】:

  • 测试这个:jsfiddle.net/thirtydot/HMfzL 使用 Chrome 12.0.742.9 dev-m / Windows 7,它对我来说可以正常工作 - 没有错误。你用的是什么版本?也许已经修好了? (或者我的测试有缺陷)
  • 您说得对,看起来该错误已在较新版本的 Chrome 中得到修复。我刚刚在开发版本中进行了测试,它工作正常。谢谢,这让我松了一口气。

标签: css google-chrome


【解决方案1】:

好的,这是 Chrome 和 Safari 的错误:http://code.google.com/p/chromium/issues/detail?id=26723

我无能为力,我想我只能忍受它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-22
    • 2021-11-27
    • 1970-01-01
    • 2017-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-31
    相关资源
    最近更新 更多