Double interaction


#1

Hi,
I would like to add button interaction that will toggle visibility of the particular block and at the same time scroll to this block.
What do you thing, or is there any walk-around?


#2

I did this manually.
The HTML code must be modified after export. Add the following code:

onclick="scrollToTarget('#your_id')"
original:
<a href="#" class="btn btn-lg btn-sq btn-d gomb2 btn-block" data-toggle-visibility="g13,g14,g15">Show Less</a>

after modification:
<a href="#" class="btn btn-lg btn-sq btn-d gomb2 btn-block" onclick="scrollToTarget('#g12')" data-toggle-visibility="g13,g14,g15">Show Less</a>

It’s working here (Show More / Show Less buttons):
http://benhodosi.com/portfolio.html


#3

There are a couple ways to do this without editing after export. You can also do this using a function in the page settings - add code section. then in the elements interaction chose Navigate to URL and add the function call:

javascript:yourFuntion();


#4

That sounds interesting. Unfortunately, I can’t write code.
That’s why I use Blocs.
I’m a graphic designer, not a programmer.
Could you explain this? Or it is so complicated?


#5

Yep, I have difficulties with that too :no_mouth:


#6

cincy, I couldn’t figure out how to make that code work on the page. Should I use code mentioned by Ben?

Thanx