- This topic has 8 replies, 2 voices, and was last updated 9 years, 6 months ago by Tom.
-
AuthorPosts
-
July 12, 2015 at 8:21 am #120366Ines Handschuh
Hi Tom
The way that parallax works at the moment is not really that impressive and a bit buggy (For some reason the image wraps back to the top on scrolling), the background image scrolls a bit under some text. Anyway, what I think most people want for the parallax effect is a section scrolling on top of a background image. This should be easy enough to do just allow the section to be a transparent colour (not sure why transparent colours are not possible in your theme?) and allow a background image for the section container. Then scrolling the page up and down will reveal different part of the background image as if you are walking past an open door (transparent section) and looking in (container background image). If you carefully design your background images in vertical sections, then you can have multiple parallax image effects for different sections.
July 12, 2015 at 9:50 am #120384TomLead DeveloperLead DeveloperHi there,
So are you basically wanting to remove the subtle movement of the background image, and just keep the background image fixed so the content rolls over it?
July 12, 2015 at 10:51 am #120390Ines Handschuhyes, that is more like the normal parallax effect found on website homepages
July 12, 2015 at 10:58 am #120396TomLead DeveloperLead DeveloperThat’s the more basic parallax effect – true parallax has the background image slightly moving as you scroll.
You can disable this by adding this code:
add_action( 'wp_print_scripts', 'generate_dequeue_parallax', 100 ); function generate_dequeue_parallax() { wp_dequeue_script( 'generate-sections-parallax' ); }
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/
Then add this CSS:
.generate-sections-container { background-attachment: fixed; }
Adding CSS: http://generatepress.com/knowledgebase/adding-css/
That should do it 🙂
July 12, 2015 at 11:33 am #120416Ines HandschuhThanks, the css makes the images fixed now however the parallax setting does not turn off the scrolling on the sections any more
July 12, 2015 at 11:53 am #120426TomLead DeveloperLead DeveloperSo the background image is still moving when you scroll?
Can you link me to the page?
July 12, 2015 at 12:01 pm #120428Ines HandschuhI used the id of the section with the css so that I can turn on/off the scrolling, I now cant seem to get the image size to fit the container properly. Seems the background-attachment: fixed; css really offset and zoomed the image.
July 12, 2015 at 12:02 pm #120429Ines Handschuhwebsite address is
July 12, 2015 at 1:06 pm #120440TomLead DeveloperLead DeveloperUnfortunately there’s not much that can be done about the stretching – when the attachment is set to fixed (the only way to get this effect), it stretches the image to fit the screen.
-
AuthorPosts
- You must be logged in to reply to this topic.