scrollTo

@russian-dima , thanks for your feedback…

  • I’m not sure why you think the conflict is at that particular position (between y438 & y519)

  • The issue is occurring at other positions of the page as well ( any page - and it’s happening at any position, actually)

  • That’s why I am inclined to think that if there is a code error/ conflict - it must be within the master page.js - since the issue is happening on every page , right?

  • Yes, I do have a number of ‘scrollTo’ codes, all over the site - there’s only one on the master page - and I have tired disabling that code to see if it corrects the ‘issue’ - but it does not !

Here’s my code for the masterPage.js ~

import wixWindow from 'wix-window';

// START ///scrollTo 'top' footer-button
export function text56_click(event) {
   wixWindow.scrollTo(0, 0, { "scrollAnimation": false })
 }

export function shape31_click(event) {
   wixWindow.scrollTo(0, 0, { "scrollAnimation": false }), show_Header() 
}
// END ///scrollTo 'top' footer-button



// START /// show/hide header on scroll up/down
function show_Header() {
    $w("#header1").children.forEach((item, i) => {
        item.expand();
 })
}

function hide_Header() {
    $w("#header1").children.forEach((item, i) => {
        item.collapse();
 })
}

var scrollDirection
var scrollPosition = 0
var scrollInterval = 500 //The lower the scrollInterval, the more precise will be the scroll-position.

$w.onReady(()=>{setInterval(()=>show_scrollPosition(), scrollInterval);})

function show_scrollPosition() {
    wixWindow.getBoundingRect()
 .then((windowSizeInfo) => {
 let scrollX = windowSizeInfo.scroll.x; 
 let scrollY = windowSizeInfo.scroll.y; 
            console.log(scrollX, scrollY)
 if ((scrollPosition !== windowSizeInfo.scroll.y) && (wixWindow.formFactor !== "Mobile")){
 if (scrollPosition < windowSizeInfo.scroll.y) {
                scrollDirection = "DOWN", console.log(scrollDirection), hide_Header(), $w('#box47').show()
 }
 else if (scrollPosition > windowSizeInfo.scroll.y) {
                scrollDirection = "UP", console.log(scrollDirection), show_Header(), $w('#box47').hide()
 }
            scrollPosition = windowSizeInfo.scroll.y;
 }
 });
}
// END /// show/hide header on scroll up/down

AND THE CONFOUNDING BIT OF THE PROBLEM IS ~

After checking everything I could think of, and still failing to correct the issue, on a hunch I DUPLICATED THE SITE - And the issue is ABSENT in the duplicate site!

  • I have not made any changes - the main site and the duplicate site are IDENTICAL

  • And yet, the issue is occurring on the MAIN SITE

  • While it’s absent on the DUPLICATE SITE

SO, I AM WONDERING - COULD IT BE A ‘BUG’ AT THE WIX END, WITH THE MAIN SITE???

Thanks again for your support!