Strange behavior of IE7 jQuery height ()

In IE7, this code does not work correctly:

        myJqObj.css("height", DEFAULT_HEIGHT);  

When it starts, it seems that the height of myJqObj is 0; However, if I request a height immediately after setting it, everything works fine:

        myJqObj.css("height", DEFAULT_HEIGHT);  
        myJqObj.height(); 

This also works:

        myJqObj.css("height", DEFAULT_HEIGHT);  
        myJqObj.width(); 

I am sure that if you run the previous code yourself, everything will work fine. All this happens in the midst of a rather complex page construction. Obviously something in my js environment is throwing an error. Has anyone seen something like this before? Any ideas to start looking for?

+3
source share
3 answers

I would clarify the specifics. Have you confirmed that your "myJqObj" object is specific enough for IE7?

CSS, FireFox, IE7, , CSS , <div id="mydiv"><p>, <div id="mydiv"><p class="myclass"> .

+1

, .

myJqObj CSS? , 0, .

0

Same problem installation height in IE7

I also decided by simply requesting the height after installing it.

This is mistake?

0
source

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