在 Opera 中设置鼠标悬停时的光标样式
我正在尝试将 ancor 的 status
属性值传递给 window.status
。下面是代码:
$('a').hover(function(event){
if ($(this).attr('status')) {
window.status=$(this).attr('status');
return false}
},
function(){
window.status='';
return false;
}
)
是的,我知道它在 IE&FF 中不起作用。让我们继续歌剧。状态通过正常,但鼠标光标保持默认状态,而不是指针。插入
$(this).css('cursor','pointer');
鼠标悬停没有帮助。如何将鼠标光标变成指针?为什么它仍然是默认的?
I am trying to pass value of status
attribute of an ancor to window.status
. Below is the code:
$('a').hover(function(event){
if ($(this).attr('status')) {
window.status=$(this).attr('status');
return false}
},
function(){
window.status='';
return false;
}
)
Yes, I know that it wouldn't work in IE&FF. Lets proceed with Opera. Status passed OK but mouse cursor remains default, not pointer. Inserting
$(this).css('cursor','pointer');
in mouseover doesnt help. How can mouse cursor be turned to pointer? And why it remains default?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 jQuery 的 插件
You can use jQuery's plugin
光标可能是“默认”,因为您的 A 的 href 为空。只需用“#”填充即可
此外,您可以使用下一个跨浏览器 hack 来操纵状态:
Cursor may be "default" because your A's href is empty. Just fill it with "#"
Besides, you can use next cross-browser hack to manipulate the status:
尝试
更新:
从方法中删除 return false。这样就可以了
try
Update:
remove return false from the methods. That will do it