How to Correct the Divi Gallery Module Content Shift on Mobile Devices

Written by Dan Mossop

Are you encountering a subtle issue with your Divi Gallery on mobile, where the content below it is briefly pushed down when you switch slides for the first time? This "once-you-notice-it-you-can't-unsee-it" bug seems to be caused by a small discrepancy in the way different devices handle CSS display properties during a slide transition.

The core of the problem lies in the temporary switch the gallery module makes to a list-item display property while transitioning between slides before settling on block. While this shift goes mostly unnoticed on desktop browsers, some mobile devices, such as iPhones, render list-item and block differently enough to cause content layout to shift during the gallery slide transition.

Fix Gallery Module Content Shift on Mobiles using Divi Booster

Divi Booster includes the option to fix this issue. You can enable from the Divi Booster settings page at:

Modules > Gallery > Prevent gallery module mobile content layout shift on first slide change

Like so:

Once enabled, the issue should be resolved.

This setting is available in Divi Booster v4.4.9 onwards.

Fix Gallery Module Content Shift on Mobiles using CSS

This issue can also be fixed using CSS. By enforcing the block display property on gallery items during the transition, we can eliminate the content shift and create a seamless experience across all devices.

Here's the CSS snippet that addresses the issue:

.et_pb_gallery .et_pb_gallery_item.et_slide_transition {
  display: block !important;
}

By adding this snippet to your child theme's stylesheet or through Divi's Theme Options custom CSS, you'll ensure that during transitions, the slide items maintain a block display. This effectively prevents any jumping or pushing content down as the slide changes.

Make sure to clear any caching on your site and test on various devices to confirm the issue is resolved. This small but effective tweak ensures a smoother and more professional look to your Divi galleries, especially on mobile devices where such nuances can make or break user experience.

Maximize Your Divi Gallery Experience!

Enhance your Divi Gallery with the Divi Gallery Booster. This plugin adds all the missing options you need to style your gallery modules effortlessly, ensuring no content shifts on mobile devices. Create stunning, smoothly transitioning galleries with ease.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

2 Comments

  1. hey Dan seems working now! Are you planning to include this in new D.Booster update or shall I manually put in css? Thanks!

    Reply
    • Hey Emiliano, that's great to hear – thanks for confirming it! The latest Divi Booster update (v4.4.8) automatically applies this fix when the gallery module image counter feature is enabled, so you won't need to add it manually.

      Since the bug happens on all galleries, not just those using the image counter feature, I'm also adding a separate option in the Divi Booster settings to fix the issue on all galleries. I'll update this post when it's available. You won't need this setting for your image counter enabled galleries, but if you use other galleries you may want to enable it to fix the issue on those.

      Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.

Latest Posts

Hide the Page Title in the Hello Elementor Theme

Hiding the page title in the Hello Elementor theme allows you to create a cleaner and more customized page layout, free from default headings that may not fit your design. This is particularly useful for landing pages or custom content layouts where the default page...

How to Hide a Divi Module When Scrolling Up or Down

In this quick tutorial, I’ll show you how to hide a Divi module when scrolling in a specific direction (up or down), so that the module only shows when you want it to. This is especially useful when using Divi’s Scroll Effects feature and you have a effect you want to...

Fade a Divi Image Module Edge into the Background

Want to create a stylish fade effect on your Divi image module—where one side fades smoothly into the background? With a bit of CSS, you can make any edge (or corner) of the image fade out: top, bottom, left, right, or even diagonally.Fade a Divi Image Module Edge...

Hide the Header and Footer in the Hello Elementor Theme

Removing the default header and footer from your Hello Elementor theme allows for a streamlined and distraction-free website design. This is especially useful when creating unique landing pages, full-width layouts, or custom headers and footers with a page builder. In...

Setting up the Divi Password Box Module

Setting up password protection on a page can help you control access to sensitive or private content in WordPress, allowing only authorized visitors to view certain sections. With the Divi Password Box module, you can replace the plain Divi password form with a fully...

Random Posts