Use a video as page background
-
hi,
I want to use a video as background, and then some imagens scrolling over it. i've tried set row video background, but it doesn't work.
thanks you in advance.
best
-
hey do you have a link to your website where the row video background doesn't work?
-
hey, yes.
http://www.nuno-maio.com/matou so this how its looking like, but i want it like this : http://www.nuno-maio.com/matou2 and then the images scrolling over it.
thanks you!
-
Hey Armin, could u see it?
thanks
best,
Nuno
-
Hey I'm sorry that I didn't look at this earlier.
Ok so since lay theme can't do this at the moment we can do it by ourselves with custom code :).
In "Lay Options" -> "Custom CSS & HTML" -> "Custom <head> content" please enter:
<style> .fixed-bg-video { position: fixed; width: 100%; height: 100vh; object-fit: cover; top: 0; left: 0; z-index: -1; } </style>
Now in "Custom HTML at bottom" enter:
<video class="fixed-bg-video" preload="" muted="" autoplay="" loop=""> <source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4"> </video>
Maybe for mobile you want to hide the video.
In "Custom CSS for Mobile Version" do:.fixed-bg-video{ display: none; }
-
@arminunruh HEY!! it worked, thank you so much!!!
http://www.nuno-maio.com/matou
one more thing please, i only want this to happen on this page, now the video is in every page how do i make just for this one?
thank you so much!!!!! :D
Nuno
-
arminunruh Global Moderatorwrote on Oct 28, 2016, 7:58 AM last edited by arminunruh Oct 28, 2016, 3:59 AM
Cool! Cool art!
You can do it like this in "Lay Options" -> "Custom CSS & HTML" -> "Custom CSS for Desktop Version"body.slug-matou .fixed-bg-video{ display: block; } .fixed-bg-video{ display:none; }
I'm using css that is only for that "matou" page. Here I wrote about how to apply css only to a specific page in lay theme http://laytheme.com/documentation.html#css-based-on-current-page
-
@arminunruh said:
http://laytheme.com/documentation.html#css-based-on-current-page
Thank you man!
And thank you for your help :D
-
Hey @arminunruh
On this website : www.dominique-sierra.fr, I tried the custom code you gave earlier to show a video as background.
In custom CSS & HTML :
<style>
.fixed-bg-video {
position: fixed;
width: 100%;
height: 100vh;
object-fit: cover;
top: 0;
left: 0;
z-index: -1;
}
</style>And in custom HTML at bottom
<video class="fixed-bg-video" preload="" muted="" autoplay="" loop="">
<source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4">
</video>The video doesn’t work on mobile version, there is just an image of the video.
Is there a way to make this work on mobile?Thx dude, laytheme is gold
-
Hi @countach
videos are not possible to display like that on mobile-phones yet.
Have a look here.
Thats a website I programmed some time ago which looks very similar.
http://belius.de/Here I use jQuery to move images around. You can copy that code if you like.
All the best!Marius
-
Ok thanks a lot @mariusjopen for having a look, I'll try to use this code;)
-
This post is deleted!
Need custom programming for your Lay Theme site?
I regularly add new features to Lay Theme for free, based on user feedback. But if you or your client need something more specific, I’m happy to offer custom paid programming tailored to your project.
Email info@laytheme.com with the subject "Custom paid programming for Lay Theme" and a short description of what you need — I’ll reply with a cost estimate.
Custom features I build often make it into future Lay Theme updates, so your idea might benefit the whole community.
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it