4

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 hover over a link where I have a hover and a different cursor. Is there a way that I can set the CSS cursor property above to important with jQuery>

0

4 Answers 4

6

Try this code for example:

$(this).css({ 'cursor': 'default !important' })
Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

No down vote by me but I guess because of the other answers saying there are problems with !important. I am still looking at all the links.
@SamanthaJ there is no problem with me. What is the different among all other answers ans with my answer.. explain
2

Just add !important after your property value:

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

Comments

1

This is the syntax,

How to apply !important using .css()?

5 Comments

How does this line up with the other answers? Now I'm a bit confused.
You need to add the implementation of your style function..
there is no method style for jQuary can you conform your source or show us a demo?
i tried to post the link, now corrected it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.