How do I change the style of the cursor with JQuer

2019-01-25 02:42发布

I want to change the style of the cursor as if it were going over a link. How do I do this?

4条回答
地球回转人心会变
2楼-- · 2019-01-25 02:52

Modify the CSS cursor value by using the css() method

$('#selector').css('cursor', 'pointer');

Demo : http://jsfiddle.net/jomanlk/H6Nta/

查看更多
手持菜刀,她持情操
3楼-- · 2019-01-25 03:04

you can play around with this

$('#divid').css('cursor','default');

for pointer

$('#divid').css('cursor','pointer');

api

http://api.jquery.com/css/

查看更多
叛逆
4楼-- · 2019-01-25 03:14

using css

http://www.echoecho.com/csscursors.htm

read here for different cursor styles

and apply it

$('#selector').css('cursor', 'value');
查看更多
女痞
5楼-- · 2019-01-25 03:18

Cursors are handled by CSS. You need something like

$('#elementid').css('cursor', 'pointer');

or for old IE browsers

$('#elementid').css('cursor', 'hand');
查看更多
登录 后发表回答