Previously I sent a question doubts and I was answered by Roi who gave me the option to post my request so I will put my doubt and him answer back to get easier
I want to create a menu that moves with the scroll of the window I put up this piece of code, in the code window does not acknowledge any error but when I go to preview mode the menu does not change its behavior. I used the wix site header with #navbar .
import wixWindow from ‘wix-window’ var prevScrollpos = wixWindow.pageYOffset; wixWindow.onscroll = function () { var currentScrollPos = wixWindow.pageYOffset; if (prevScrollpos > currentScrollPos) { $w(" #navbar “).style.top = “0”; } else { $w(” #navbar ").style.top = “-50px”; } prevScrollpos = currentScrollPos; }
Hi Raphaela,
It is not possible at this moment to manipulate position of elements with code.
Feel free to post your request in our Feature Request forum.
Roi.