Elementor Change image on mouse wheel

Uses Plugins

Elementor PRO


This tutorial is in response to a question in the Global Elementor Facebook Community.

The author wanted to know how to achieve the image stepping effect here https://www.apple.com/iphone-se/

This tutorial shows both how to extract frames from a video and how to achieve this using a standard Elementor Basic Gallery Widget, and custom JavaScript.


Create a section with dummy content

Create a section with any dummy content, to be used at the top and bottom. This is just for scrolling.


Create a middle section

Create a standard section to contain the Gallery Widget.

  1. Set-top and bottom padding
  2. Set a background color
  3. Set the Section ID to "wheel-progress"
  4. Add a standard Basic Gallery Widget and select images




Copy the CSS below.

Paste it into the above section - Advanced->Custom CSS



  1. Add an HTML Widget to the editor, just below the Basic Gallery Widget.
  2. Copy the Javascript Below and paste it into the  "Content"

Code (click to copy)

JavaScript code for HTML Widget (javascript)

    ;( w=> {
        const sectionSelectorID = 'wheel-progress';
        const targetSection = document.getElementById(sectionSelectorID);
        const imageItems = targetSection.querySelectorAll('.gallery-item');
        const imageCount = imageItems.length;
        let currentImage = 0;
        const init = ()=>{
            targetSection.addEventListener('wheel', (e)=>{
                if(e.deltaY > 0){
                    newItem = currentImage +1;   
                    newItem = currentImage -1; 
                if(newItem > -1 && newItem < imageCount){
                    targetSection.scrollIntoView({behavior: "smooth", block: "center"})
        const updateItem = i => {
            /* Hide All */
                el.style.display = 'none';
            /* Show only the current image */
            imageItems[i].style.display = 'block';
            currentImage = i;
         w.addEventListener('DOMContentLoaded', init);

CSS for Section containing the Gallery (css)

/* initially hide all except the first */
selector .gallery-item:nth-of-type(n+2){
    display: none;


Note: Depending on your Browser, JSON files may open in your Browser when clicked. To save the JSON, Right-click the “download” link, click “save link as”.

Demo page template