Parallax video background instead of image

不问归期 提交于 2021-01-29 22:28:49

问题


I wanted to know if it's possible to insert a video mp4 file in the parallax effect instead of an image? I tried a few different codes but all won't work. Any ideas?

I tried to recreate the parallax effect in a snippet for you to take a look if it's possible to insert a video file there or not.

.parallax-window {
    min-height: 42vw;
    margin-bottom: -42vw;
    background: transparent;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
<script src="https://u.jimcdn.com/cms/o/s83f47c4a38d26e7e/userlayout/js/parallax.js?t=1583292164"></script>

<div class="parallax-window" data-parallax="scroll" data-z-index="1" data-image-src="https://images.ifun.de/wp-content/uploads/2020/01/mac-wallpaper-mashup.jpg">
</div>

来源:https://stackoverflow.com/questions/62314791/parallax-video-background-instead-of-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!