I use the following (not working code):
var height = $("#rows").children().get(index).height();
The thing is that .get(index)
returns the DOM element.
So after that the height() method does not exist.
How can I work around this problem?
答案 0 :(得分:2)
use eq()
var height = $("#rows").children().eq(index).height();
or
var height = $("#rows").children().get(index).clientHeight;
NOTE: get()
will be converted to javascript object so there is no height() method in javascript