Reputation: 157
Is there a way I can use JQuery's .css() method to give the following cursor style?:
cursor: url(http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur), default !important;
Upvotes: 4
Views: 5806
Reputation: 7466
jQuery doesn't understand the !important
, so if you remove that it'll work:
$('selector').css({
'cursor': 'url(http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur), default'});
There are ways to get around it, why not use a CSS class?
/* CSS */
.cursor {
cursor: url('http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur'), default !important;
}
So you can just:
$('selector').addClass('cursor');
There are other alternatives too, see: How to apply !important using .css()?
Upvotes: 6