jQuery, checking to see if video has height/width

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-04-27T00:38:05Z Indexed on 2010/04/27 0:43 UTC
Read the original article Hit count: 329

Filed under:
|
|

I have a <video> element that is generated by js, and I need to get the height and width of it.

var v = $('video'); v.height() returns null, because when it's run, the video hasn't yet been loaded, so no dimensions in the DOM.

How do I check to see if the video has received a dimension, and if it hasn't, wait till it has to get the height and width.

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about dom