在 Opera 中设置鼠标悬停时的光标样式

发布于 2024-11-25 12:11:08 字数 499 浏览 0 评论 0原文

我正在尝试将 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吻安 2024-12-02 12:11:08

您可以使用 jQuery 的 插件

You can use jQuery's plugin

江湖彼岸 2024-12-02 12:11:08

光标可能是“默认”,因为您的 A 的 href 为空。只需用“#”填充即可

此外,您可以使用下一个跨浏览器 hack 来操纵状态:

<a href="Message: this text will appear in the status bar">link</a>

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:

<a href="Message: this text will appear in the status bar">link</a>
时光是把杀猪刀 2024-12-02 12:11:08

尝试

$(this).attr('style', 'cursor:pointer !important')

更新:
从方法中删除 return false。这样就可以了

try

$(this).attr('style', 'cursor:pointer !important')

Update:
remove return false from the methods. That will do it

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文