I’ve tried to create a sticky header - and have it reveal using the onViewportLeave function. I’ve tried to link it to one of the strips. But as you can see from the bottom image the text isn’t appearing in the strip when I scroll down the page. It’s probably dead simple, but I’m so new to Corvid and just have no idea. Any help would be appreciated - thanks community.
Hello zzzdettmann,
well first at all, please show CODE always in CODE-TAGS. You will find this OPTION here…
Already have seen this example here?
https://www.wix.com/corvid/examples?search=sticky
Thanks russian-dima, will know from now on.
Yeah I have seen that example, not sure what I’m doing wrong.
$w.onReady(function () {
// TODO: write your page related code here...
$w("#headertransition").onViewportLeave(() => {
$w("#Scroll").show();
$w("#Header1").hide();
})
$w("#headertransition").onViewportEnter(() => {
$w("#Header1").show();
$w("#Scroll").hide();
})
});
Perhaps this example may help you…
https://russian-dima.wixsite.com/meinewebsite/reading-position
Here you will find the same function in another situation.
A STRIP (red) leaves the viewport and activates process-1.
When it comes back to vieport, it activates process-2.
It looks like your code is correct, but the text element might not be attached to the strip element (happens to me sometimes). Maybe try to drag it off, and then drag it back until you see the “Attach to Strip” message.
Hey LMeyer, thanks for the suggestion.
I thought that might have been the case, but after checking again it looks like they are all in fact attached to the strip. Appreciate it though.
That’s crazy! I’ve never seen a “parent” element appear without it’s “children”…
I can only think of a couple more things:
- Double check that all the element IDs exactly match what’s in the code, including capitalization (for example #BigBox and #bigbox are not the same)
- Do you have the text elements individually set to be Hidden on Load ? If the strip is set to Hidden on Load , then the text elements will automatically be. But if the text elements are individually set to Hidden on Load , then that would explain why they’re still not appearing.
- You might need to contact Wix Support , it could be a bug or something else that they can help fix.
I hope you can figure this out!
Thanks for your patience guys. I’ve just worked it out!
Was checking everything, and for some reason the trigger strip itself was set to Hidden on Load . Not sure why it was tricking me into thinking it was sort of working. Appreciate the help man!