How to set an important flag in css using jQuery?

Possible duplicate:
JQuery css: applying important styles

I have the following code:

$("body") .ajaxStart(function () { $(this).css({ 'cursor': 'progress' }) }) .ajaxStop(function () { $(this).css({ 'cursor': 'default' }) }); 

This works, but not when I was linking to a link where I have a hang and another cursor. Is there a way I can set the CSS cursor property above to a value using jQuery>

+4
source share
4 answers

Try using this code, for example:

 $(this).css({ 'cursor': 'default !important' }) 
+6
source
 $("body") .ajaxStart(function () { $(this).css({ 'cursor': 'progress !important' }) }) .ajaxStop(function () { $(this).css({ 'cursor': 'default !important' }) }); 
+3
source

Just add !important after your property value:

 $("body") .ajaxStart(function () { $(this).css({ 'cursor': 'progress !important' }) }) .ajaxStop(function () { $(this).css({ 'cursor': 'default !important' }) }); 
+2
source

Source: https://habr.com/ru/post/1433317/


All Articles