Thank you! Used the following code instead incorporating anchors.
The first time I use the code it works perfectly, but when I try to duplicate the code to link a different text to another anchor it doesn’t work.
I’m assuming I need to differentiate the codes somehow, but I’m not sure how?
Hi! I want to have the exact same effect on my site, and tried both the solution Rasmus Karlsson wrote and also other offered solutions from the threads about onViewportEnter but i cant get anything to work
Can someone please help?
This is my code right now, and nothing with it works…
$w . onReady ( function () {
});
export function anchor1_viewportEnter ( event , $w ) {
$w ( “#text29” ). show ( ‘fade’ );
$w ( “#line12” ). show ( ‘fade’ );
$w ( “#text30” ). show ( ‘fade’ );
}
I got the function running perfect with my first paragraph, and when adding the exact same structure of code (but with changed event-triggers and event targets), it doesnt work the same on paragraph 2. I get the onViewportLeave to work on second paragraph but not onViewportEnter. And everything is exactly like on the first paragraph… im going crazy…
@jonatandor35 Yepp anchor5 is the right anchor for entrance! Its so weird, i havent changed anything with the code but i closed the site, went to editor for another site, and then went back to the editor with the code, and now it works! I have no idea why…