Slideshow Pauses when mouse hovers over it

Topic summary

Issue: The homepage slideshow pauses on mouse hover (it fills the screen and has clickable content), so it never auto-plays. The goal is to disable the hover-to-pause behavior in a Shopify theme.

Key fix: Edit the theme’s JavaScript (Assets > global.js). In the SlideshowComponent, locate the function named focusInHandling(event) and prevent it from pausing on hover by removing or commenting out the line that triggers this.pause() when the autoplay button isn’t focused. This keeps autoplay running even when the mouse is over the slideshow.

How to find it: Open global.js and use Ctrl+F/Command+F to search for “focusInHandling” (or SlideshowComponent). Community provided screenshots to pinpoint the exact code block.

Outcome: After applying the change (commenting/removing the pause logic), the original poster confirmed success. The thread is resolved; no remaining open questions.

Summarized with AI on January 11. AI used: gpt-5.

My slideshow has clickable content and since it takes up the entire screen, your mouse will always be hovering over the image, meaning the slideshow never gets to play. I would like to disable the pause on mouse hover feature but not sure what code I would need to edit to do it.

Store URL - faithandyou.in

Hi @AryavK
In the global.js find code → focusInHandling

Replace the below code with

focusInHandling(event) {
    const focusedOnAutoplayButton = event.target === this.sliderAutoplayButton || this.sliderAutoplayButton.contains(event.target);
    if (focusedOnAutoplayButton && this.autoplayButtonIsSetToPlay) {
      this.play();
    } else if (this.autoplayButtonIsSetToPlay) {
      this.pause();
    }
  }

This code:

focusInHandling(event) {
    const focusedOnAutoplayButton = event.target === this.sliderAutoplayButton || this.sliderAutoplayButton.contains(event.target);
    if (focusedOnAutoplayButton && this.autoplayButtonIsSetToPlay) {
      this.play();
    } else if (this.autoplayButtonIsSetToPlay) {
      // this.pause();
    }
  }

hy @AryavK

Please go to Actions > Assets > global.js file, find ‘SlideshowComponent’ and remove code here:

hello @websensepro and @Huptech-Web , i tried to find them, i know they are there, the thing is, GLOBAL.JS is such a big file, it will take ages to find it

Hi @AryavK
Open the global.js file and press ctrl + f for Windows or if Mac then press Command+F once the search window opens at the bottom add find this - > focusInHandling ( Check screenshot :backhand_index_pointing_down: )

\

3 Likes

thank you so much @websensepro

you are the best

you do not know how much this mens to me.

thanks g

You’re very welcome! I’m glad I could be of help. If there’s anything else I can assist you with, just let me know!