On the problem of taking width and height values of multiple li

there are multiple li
var liheight = $(".djstatr-boxdetail li") .height ();
get li height
alert (liheight) the value taken is 0
alert ($(".djstatr-boxdetail li") .height ()) in order to get the value

.

Rookie, may I ask why?

Apr.29,2022

No more complete code can be posted. The code you reply cannot test the problem locally.


there is no problem with calling variables. Your reason may be where the variable acquisition is incorrect. For example, your li default height is auto adaptive, but before the content is loaded into, your variable gets 0. So when you assign a value to a variable, there may be no content in li

.
Menu