Abdur Rehman Farooqi
Abdur Rehman Farooqi

Reputation: 49

How to align videos, their height and wifth and their progress bar on the page

I have a function that works fine and videos are played properly but these videos are shown in a single line but I want one video in one line and all the videos should have same width and height.

function appendReturnedVideos(data) {

    var $html = $();

    $.each(data.videos, function(index, element) { 
        $html = $html.add($("<video/>", { 
            height: 360,
            css: { 'max-width': 480},
            src: element,
            controls: true,
            preload: 'auto' 
        }));

        $("#videos").append($html);        
    });
}

HTML part:

<div class="container-fluid" id="myElement">
    <div id="videos"> </div>
</div>`

Upvotes: 0

Views: 33

Answers (1)

AmmarCSE
AmmarCSE

Reputation: 30557

Before $("#videos").append($html); add a break like

 $html = $html.add('<br/>');

DEMO

Upvotes: 1

Related Questions