So I got parallax working on 7 image layers that make a city, but it only displays at the top of the site when I need it to be in a DIV just above the footer
How do I achieve this? Can anyone tell me what I’m doing wrong please?
I’m trying to figure out how to make it work where I’m placing the DIV just above the FOOTER and making the parallax effect only happen when I scroll down to when the images are actually in the VIEWPORT.
Is there a way to do this without a plugin or using jQuery?
100vh is based on the viewport height, so you might want to use something else there… or, just remove it, since you have heights defined before that get overridden with that value. Note too, that your #parallax and .plx_group are the same objects so there’s redundancy there as well.
Basically, place your #parallax div where you want it to be and position everything inside of it relative to that div. What seems to be messing you up there is the vh units and the fixed position. Use absolute positioning for your layers instead.
Thanks for the response. I made the appropriate changes, but it’s still showing up at the top of the page… The #parallax div is supposed to be just above the footer, but its showing up at the top of the page when I set the images to fixed, and nothing shows anywhere if they are set to absolute…
if I apply #parallax -> relative, .plx_layer -> fixed, and no position to the individual imgs, then the imgs are spread out from top to bottom across the entire page.
I’m at the point where I’m just trying to find someone to paypal money to fix this for me…
Its usually not hard to find a library that does this stuff a little more automatically. Parallax is a pretty popular behavior and I’m sure there are libraries/tools out there that make it easy.
There’s still a gap between the footer and the parallax div that is always getting bigger or smaller depending on the scroll, but I think I can figure it out. I’m trying to make the last img stay right on top of the footer and the other 5 images above move up and down accordingly…
Yeah, which is great for DIY. But if you’re looking to just get the behavior with minimal effort, then you might want to look into something like (me and my lacking googling skills…) https://codecanyon.net/item/the-parallaxer-wp-parallax-effects-on-content/9594931 or something like that where it is more drop in some code and set a few parameters here and there.
Creating engaging and entertaining content for designers and developers since 1998.