i want to get the height property of a object:
$('.selector img').each(function(index,e){
thisImage = $('#topContent img').get(index);
}
so long no problem, but then i want to get the height like this:
thisImage.height;
i thought it was equvivilent to:
thisImage.height();
or:
thisImage.css("height");
开发者_运维百科
but neither does work for me.
And the greatest problem is that
thisImage.height;
Dose not work in chrome.
Have i missed something or is this a known bug? is there another way to get the height in chrome?
Specifically the object returned by get()
is going to be the actual DOMElement not the jQuery object so you need to wrap it in jq. like $(thisImage).height()
or use the actual selector as Catfish suggests.
try
var thisImage = $('#topContent img').height();
精彩评论