How to Fix Divi Parallax Not Working on Safari

I recently discovered that Divi’s Parallax feature doesn’t work on Safari (on November 2024). When you scroll down, the background image just scrolls with the page like a regular background image. It doesn’t work whether you choose “True Parallax” or “CSS”.

It works on all other browsers.

According to this Reddit thread, the problem happens in Mac OS Sonoma and has been that way for over a year.

The Culprit

Divi has a class, “et_mobile_device” that it is supposed to add when viewing the site on mobile. When that class is present, the background attachment for the parallax background image is set to “scroll” because we don’t want parallax on mobile (the background image gets stretched to the full site height instead of browser height and will be super zoomed in).

The problem is that Divi is adding that class on Safari, even when on desktop. Thus, the parallax backgrounds are set to scroll with the page instead of being fixed.

The Fix

This first fix is for the “CSS” parallax method:

Divi CSS method setting

The fix is to add this CSS to your site (usually in the Customizer or a child theme):

/* FIX FOR PARALLAX ON SAFARI NOT WORKING */
@media all and (hover: hover) {
	.et_pb_section_parallax .et_pb_parallax_css, .et_pb_slides .et_parallax_bg.et_pb_parallax_css {
	background-attachment: fixed !important;
  }
}

This overrides the mobile class when the browser has “hover” capability, i.e., it is not a touch screen.

As I mentioned, this does not affect “True Parallax” mode. Any sections that are set to “True Parallax” won’t have the parallax effect on Safari. The background image will just scroll with the content.

There is no fix for True Parallax on Safari other than to make it behave like CSS parallax. If you want to do that, use this code:

@media all and (hover: hover) {
.et_mobile_device .et_pb_section_parallax .et_parallax_bg, 
.et_mobile_device .et_pb_slides .et_parallax_bg {
	background-attachment: fixed !important;
  }
}

In other words, use this code if you have sections set to “True Parallax” and you are OK with them behaving like CSS parallax on Safari.

Conclusion

Did these work for you? Questions? Please leave a comment below if this helped you. – Brian

Shares

Discover more from Web Developer Tips and Tricks

Subscribe to get the latest posts sent to your email.

Please Leave a Question or Comment

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments