Javascript/jQuery

[jQuery] 비디오 객체에 꽉차게 하기

728x90
반응형
var $video = $('video'),
        $window = $('.video_box');

    $(window).resize(function () {
        var height = $window.height();
        $video.css('height', height);

        var videoWidth = $video.width(),
            windowWidth = $window.width(),
            marginLeftAdjust = (windowWidth - videoWidth) / 2;

        $video.css({
            'height': height,
            'marginLeft': marginLeftAdjust
        });
    }).resize();

stackoverflow.com/questions/20127763/video-100-width-and-height

728x90
반응형