jQuery USES height of to get the height you need to pay attention to

  • 2020-05-05 10:53:38
  • OfStack

This article gives an example of where jQuery USES height() to get the height. Share with you for your reference. The specific analysis is as follows:

The jQuery script is as follows:

var aNode = $('#demo');
var height = aNode.height(); // If you're getting height Before, aNode Is already display:none Or, aNode Is hidden, then can not get aNode The height of the
console.log(height);

The HTML page reads:

<div id="demo" style="display:none"> Here is hidden, cannot get height! </div>

I hope this article has been helpful to your jQuery programming.


Related articles: