防止视频出现最大宽度跳动

时间:2019-07-11 09:56:58

标签: css video aspect-ratio

我正在尝试使视频在加载时不会跳动,我应用了长宽比填充技巧,该方法效果很好,但是当视频需要最大宽度时,并不是这样,所应用的填充似乎太多,无法正确放置。有什么想法吗?

参考链接: https://css-tricks.com/aspect-ratio-boxes/ https://itnext.io/how-to-stop-content-jumping-when-images-load-7c915e47f576

$parentfolder= array();
    foreach ($directory  as $dir) {
        $row_array = array();
        $row_array["id"] = $dir[id];
        $row_array["data"] = array();
            foreach (subdirectory as $sub) {
                if ($dir["id"] == $sub["dir_id"]) {
                    $row_array["data"][] = array(
                        //and so on..
                    );
                }
            }
        array_push($parentfolder, $row_array);
    }

小提琴: https://jsfiddle.net/ko1L84b5/2/

0 个答案:

没有答案