Check out this website for a good example:
If you take a look, you'll notice that the header youtube video is responsive - it automatically resizes when the window size changes. Here are the <iframe>
codes:
<iframe id="bluetube-player-1" frameborder="0" allowfullscreen="1" title="YouTube video player" width="944" height="531" src="https://www.youtube.com/embed/F1jpCBPiWS4?showinfo=0&rel=0&controls=0&modestbranding=0&wmode=transparent&enablejsapi=1&origin=http%3A%2F%2Fzh.gopro.com" style="width: 1125px; height: 633px; left: 0px; top: -158.5px; position: relative;">
</iframe>
I noticed that the width
, height
, and style
attributes are all responsive on this page. However, I couldn't figure out how the author achieved this (is it through CSS or JS?).. I attempted to search using bluetube
in jQuery but still couldn't grasp how it's done..
Does anyone have any insights on this?