开发者

Changing cursor style in Chrome fails when user is hovering over a link

开发者 https://www.devze.com 2023-03-07 00:13 出处:网络
I have a strange problem that i\'m seeing in Chrome. I use an ajax callback to set the cursor\'s css style to \"wait\" when a sidebar link is clicked. This works perfectly in firefox, but on Chrome t

I have a strange problem that i'm seeing in Chrome.

I use an ajax callback to set the cursor's css style to "wait" when a sidebar link is clicked. This works perfectly in firefox, but on Chrome the cursor style only changes when I hover away from the link - i.e. the style does开发者_运维技巧n't change whilst the user is still hovered over the link

What am I doing wrong? Here's the relevant code:

// 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) %>");
});

As you can see I am explicitly setting the css for all anchors too with $('a').css('cursor', 'wait'); so that it works in firefox but Chrome doesn't seem to take notice of this.


ok, it's a Chrome and Safari bug: http://code.google.com/p/chromium/issues/detail?id=26723

not much I can do about it, I guess I can just live with it

0

精彩评论

暂无评论...
验证码 换一张
取 消