• Resolved frehbein

    (@frehbein)


    Hi,

    I’m trying to add a scroll snap “animation” to the section that comes after the scrollsequence.

    After the scrollsequence the scrolling speed looks like it’s too fast because of the sudden change of a sticky section to a normal one. As a solution for this I’m trying to add a scroll snap to the section that comes right after scrollsequence. I tried both, code (HTML, CSS and javascript) and elementor pro’s scroll snap option but nothing is working.

    What I have is:

    -Section 1 – Scrollsequence
    -Section 2 – A text widget that goes above section 1 when scrolling. This section scrolls up and sticks to the top until section 1 ends.
    -Section 3 – a video widget that I want to have the scroll snap effect or something similar that slows down or stops the section from scrolling so the viewer can adapt its vision from the scrollsequence flow to a normal one.

    Until now, what I’ve gather is when I add scroll snap to section 3, section 2 doesn’t unstick when section 1 ends and stays fixed the whole page. The scroll snap effect doesn’t works either.

    This is the code I have for section 2 that is probably in comflit with scroll snap:


    <style>

    .fixed-div { position: sticky; top: 0; z-index: 999; } (section 2)

    .unfixed { position: absolute !important; }

    .video-intro { height: 100vh; } (section3)

    </style>

    <script>
    
    var scrollEnabled = true; 
    
    window.addEventListener('scroll', function() { 
    var fixedDiv = document.querySelector('.fixed-div');
    var videoIntro = document.querySelector('.video-intro');
    var scrollY = window.scrollY || window.pageYOffset; 
    
    if (fixedDiv && videoIntro) { 
    var videoIntroPosition = videoIntro.getBoundingClientRect().top; 
    var unstickThreshold = 500; // Adjust this value as needed 
    
    if (videoIntroPosition <= unstickThreshold) { 
    fixedDiv.classList.add('unfixed');
    fixedDiv.style.top = (videoIntroPosition - unstickThreshold +
    scrollY) + 'px';
    } else { 
    fixedDiv.classList.remove('unfixed'); 
    fixedDiv.style.top = '0';
     } 
    // Check if scrolling is temporarily disabled 
    if (!scrollEnabled) {
     window.scrollTo(0, scrollY); 
    } 
    } 
    }); 
    
    // Disable scrolling for a few seconds 
    function disableScrolling(duration) {
    scrollEnabled = false;
    setTimeout(function() {
    scrollEnabled = true;
    }, duration);
    }
    
    // Call the disableScrolling function with the desired duration (in milliseconds)
    disableScrolling(2000); // 2000 milliseconds = 2 seconds
    
    </script>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Scrollsequence

    (@scrollsequence)

    Hi frehbein,

    Could you please share the URL with us so I can see what you are doing?

    Ales

    Plugin Author

    Thread Starter frehbein

    (@frehbein)

    Hi Ales,

    here is an example of what my page looks like: https://test.aurapartners.pt/?page_id=2805

    I’d like the section after the scrollsequence (in this case, the video section) to do the scroll snap effect. Example of what I’d like to happen: https://plasticenergy.com/#Intro – when you scroll, there is a subtle pause in each section.

    Plugin Author Scrollsequence

    (@scrollsequence)

    Hi frehbein,

    Thanks for the information provided.

    Scroll snap effect as in the example you have provided is not part of the plugin. We try to avoid “scroll jacking” technique because it is quite controversial.

    Nevertheless I you can just add the video into another Scene – this way it would be fixed to the screen and would seem natural. To add a Scene, press the plus button at the top of the plugin UI.

    Also in the premium version you could animate the video position in sync with the scroll using a “from” animation to make it even more intuitive.

    Let me know if any of the above helped you out ??

    Ales

    Plugin Author

    Plugin Author Scrollsequence

    (@scrollsequence)

    Closing this topic

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use scroll snap after scrollsequence ends’ is closed to new replies.