I can scroll the page to the top of an element like this:
$w('#someElement').scrollTo();
I need to scroll to a position 100 pixels ABOVE that element.
Scrolling to hard-coded specific pixels on the page is NOT a solution - this needs to be more robust than something that will break every time I move or add an element in the editor, or if there is a dynamic element above it that might shrink or grow. Anyone who suggests this as a solution is publicly admitting they think The Phantom Menace is the best Star Wars movie…
I’ve tried:
$w('#someElement').scrollTo(0,-100);
I’ve also searched without success to see if it’s possible to get the coordinates of an element so I could do something like
let top = $w('#someElement').top;
wixWindow.scrollTo(0, top, {"scrollAnimation": true});
Anyone have any suggestions?
#scrollTo #animation #scrolling #coordinates