I have seen simular questions and awnsers about this where they talk about collections and permissions. Most toppics where closed, so I could not add my question here. I will provide the screenshots that might help you help me.
The goal:
Click on a hoverbox (ID stickerMaakOfferte) wich then slides to an anchor (ID: anchor10).
The issue:
When I’m in the preview mode, everything works as it should. But when I publish the site and check it, it does not work at all. Now I have read somethings about data collections and permissions. This does not seem to be needed for this simple function. But this is me, a noob, who thinks this.
The code:
I hope someone could help me in childlike language… sorry, I am realy not that great. Just beginning here haha.
This can be done without coding just link the anchor with hoverbox.
If you want to do this by coding go through the velo by wix documentation.
for coding:- 1. add code in onready() function
2. use $w instead of $item.
Thank you so much for your reply! I used the $w, but this wil be deprecated, so I wanted to start with the correct semantics.
As for the linking to the anchor, this does not seem to be an option. I do know that you can link basic shapes (as I did before). But this does not seem to be the case with the box (star shape) that I am using (the sun hoverbox). So it just doesn’t seem to work… also when I put it in onready()…
Hello bmjbakker,
first of all —> do not show code in a pic. Anybody wants to retype all your code manually. It’s waste of time!
Show your code in CODE-BLOCKs like this…
let $item = $w.at(event.context);
if($item("#StickerMaakOfferte").onClick
$item("#anchor10").scrollTo();
- You are using a REPEATER ??? You didn’t mentioned anything about a repeater.
Like → “Just-Testing” already mentioned, if you do not use a repeater you can’t use → $item —> instead you should use —> $w.
Your code would then look like something like this…
$w.onReady(()=>{
$w('#stickerMaakOfferte').onClick(()=>{
$item("#anchor10").scrollTo();
})
});