I'm trying to make a div the same height of a video on my website.
so I executed this:
var videoHeight = 0;
videoHeight = $("video").css("height");
$(".tester").css("height", videoHeight);
in
$(document).ready(function(){}
and in
$(window).resize(function(){}
but the height is only accurate when I resize the window, not on refresh. What should I do ?
when refreshing : the video is 554 pixels high and my div 493 pixels
when resizing : it is equal
Any ideas ?
EDIT:
Here is my video tag:
<video class="video" preload="auto" loop="loop" controls>
<source src="video/demo.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>