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 Roi thank you so much!
Taking advantage of the fact that you were solicitous, could you take other doubts? Before I start a project in wix code and cannot continue because of lack of resources.
How often can the number of pages affect the performance of the site and cause its load to be slow? i.e., an ecom store may start small and need more category pages as the variety of products increases
Another thing if I create a category dynamic page for articles (e.g., blog post) I can put a user input form for comments?
In this form I can send to the data collections the date of publication (document.write (Date ())?
And when the article loads display the comments of the respective article, which was previously filtered by date and moderated by the site owner
The latter, it would be possible to also make a user input for customer reviews on a product page, creating a data collection and associating the review with (e.g., SKU) and loading the page display the review for the specific product of that SKU ?
Thank you in advance for responding!
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.