JavaScript Change Cursor Icon
I already have the conditions and everything worked out, only thing I need is the syntax in JavaScript to change the cursor to the hand, like the user has moused-over a link, and then I need the syntax to change the cursor to the arrow, like they moused-out of the link. Not much to it, just need the JavaScript syntax for changing cursors.
Only thing is this needs to work in开发者_如何学Go IE, FF, Chrome, Safari, and preferably Opera.
Thanks in advance!
First, I'm shocked this question has no answers and no comments about how easy it would be to Google the answer.
The syntax you're looking for is: object.style.cursor = 'pointer'
, where object
is the DOM object for which you're trying to change the cursor.
Here's an example: http://jsfiddle.net/3q5Yh/
You would be done using below syntax.
$('.className').css('cursor' , 'pointer'); // using className Selector.
Or
$('#idName').css('cursor' , 'pointer'); //Using Id Selector.
精彩评论