Streaming live at 10am (PST)

Scroll back after show/ hide


#1

Here's this scenario:
(1) you click on a given element;
(2) content shows;
(3) on bottom of content there's a "hide" button;
(4) when you click the hide button the content hides;
(5) the problem at this stage is that you do not get scrolled back to the original element you clicked on, so as to show content.

Is there an elegant solution to this?


#2

Yes.

Give a unique ID (in the settings panel) to the section (it's good to do it on sections) that contains your element. So when you follow a link to this unique ID/anchor, it scrolls until the top of the section reach the top of the browser.

Use a link block to wrap the element to which you give the fold/hide interaction. Edit the link and make it point to the unique ID you've created.

Don't start the name of the unique ID with a numerical digit or you'll lose the smooth scroll.

You'll end up with a smooth scroll to the top of your element. The scroll happens at the same time of your hide/fold interaction. So both anims at the same time sometimes is weird. Adapt/change your hide/fold interaction delays values to address this.


#3

Thanks a million, Vincent !


#4

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.