I am using a Repeater list with a data collection to display over 40 products/services. I want to add anchors to each product so I can link to them from other places on the site. How do I do this? The data collection dynamically displays the content in the repeater list so adding an anchor to the page doesn’t work.
Hi,
You can use the scrollTo() function to navigate to a specific location in your page, save variables with wix-storage to pass the location between pages.
Let me know if you need further help,
Or
Hi! Is there any tutorial available explaining the scrollTo function when using with/as an anchor?
Please add a new post rather than bump an old thread from 2018.
You can use the Anchor API to see how to do this.
https://www.wix.com/corvid/reference/$w.Anchor.html
How do I scroll to a specific point on my page?
Add an anchor to your page and use the scrollTo() function.
You can also use scrollTo() to scroll to a specific element on your page, or use scrollTo() with wix-window to scroll to an x-y coordinate on your page.
If you are trying to use anchors with repeaters then you will need to use it with inline actions and not global actions
Calling the scrollTo() function on an element in a repeated item that is selected from the global scope causes an error.
Global is actions that happen outside of the repeater, whereas inline are actions that work inside the repeater itself.
You can read more about repeaters here.
https://www.wix.com/corvid/reference/$w.Repeater.html
Along with an example of using inline and global actions with a repeater.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-input-repeaters
Old post closed.