function positionElements(){
var vidHeight = $('#video').height;
var displace = parseInt(vidHeight, 10) * 0.8;
var topMargin = displace+'px';
$('#video-overlay').offset($('#video').offset()).width($('#video').width());
$('#video-overlay p').css('margin-top', topMargin);
}
I’m getting NaN for this.. I thought parseInt was supposed to get me past that. What do I need to do to perform multiplication in here?
You’re missing the parentheses after the
height:Without them, you are passing in the
heightproperty of the object, and as that object is an instance of jQuery, theheightproperty is simply the jQueryheightfunction itself, rather than the result of that function.