开发者

setting cursor style in mouseover in Opera

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 t开发者_开发知识库urned to pointer? And why it remains default?


You can use jQuery's plugin


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>


try

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

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜