0

jQuery is being used to set the height of each element, I want to override this by another bit of jQuery.

The code works as I've tried it on a child div:

var height = $('#module-104').height();
            console.log(height);

            $("#module-103").css({
                     'height' : height,
                     'padding-top' : 0
                 }); 

I've tried wrapping my code in the following tags to load it last but with no success.

$(document).live("on", function(){

                });

and

 $(window).bind("load", function() { 

 });

Any ideas? or would it be a simple case of adding !important to the height? if so what's the syntax for that in jQuery?

Cheers

Z0idberg
  • 43
  • 1
  • 6

1 Answers1

0

Give the overriding script at end of the page(after all your scripts) and bind it inside window.onload

$(window).bind("load", function() { 
//Overriding code
$("#module").css( 'height' , height+"px !important");
});

If you are updating the css on an event, then make the above code inside a function, and call the function at the callback of the event or any code you want to override.

sarath
  • 343
  • 8
  • 31