how to use !important in jQuery animate() function


Tags: jquery,css,jquery-animate

Problem :

Please see the jQuery below:

I am really wondering how can I use CSS !important for height in this code.

        $j('#lveis-wrapper_3').animate({
            opacity: 0.0,
            height : 200
        }, 1200);

The CSS of #lveis-wrapper_3 is below :

#lveis-wrapper_3
{
    width: 844px !important;
    height: 936px !important;
    margin: 0pt 0pt 10px !important;
    padding: 0pt !important;
    float: none;
}

I can not remove !important from height: 936px for some reasons...
so I want to change that height by animate() jQuery function - but how?



Solution :

You just cannot do this.

As per jQuery documentation...

"All animated properties should be animated to a single numeric value... ... most properties that are non-numeric cannot be animated using basic jQuery functionality..."

http://api.jquery.com/animate/


I strongly recommend re-examining your need for !important.


    CSS Howto..

    How to add a css class into my function

    How best to use jQuery: with HTML or CSS for formatting

    How do I convert scss to css

    How can apply multiple background color to one div

    How to Reset CSS after Media Query?

    How to set fit-content for width in right side - dynamic content width

    How to calculate the multiplication factor for scroll speed on another element so that they both reach end at the same time (top of view)

    How to vertically center a child element of arbitrary size inside a floated parent element (of known size)?

    How to keep css content position when zooming in and out?

    Yahoo's new blur effect in web mail - How?

    How to override css grouped styles

    How can I make an div span the entire width of my screen

    How to unhecked parent checkbox

    How do you spin side to side using css3 animation?

    How to center my hmenu (no matter the resolution)?

    What is the problem with Visual Studio.Net's “absolute positioning”, and how is that problem fixed by CSS's “absolute positioning”?

    site only shows half screen on mobile? Rest of screen is just body background?

    How can I rotate(or change) background image using CSS and Javascript

    CSS - How to break long words in a table td?

    How do I align columns in the center of the page? [duplicate]

    When using padding-top to retain aspect ratio for fluid layout, how do I vertically center text to background image?

    how would I use Javascript, html and css to produce the running tiger effect seen in run4tigers website? [closed]

    How can I center the nav menu items using bootstrap 3?

    How to add jQuery file to navigation website?

    How to prevent html div from expanding when text size is changed

    How to make the background of my text larger?

    Javascript: Hover over Issues & How can I structure the html efficiently?

    HTML & CSS: How do I completely remove the scroll-bars on the side of
    ?

    CSS attribute selectors: how to escape newlines within attribute value?

    how to add css to selected row in treegrid GXT 3