This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Frederic Munch
Posted Aug 18 - Read on Facebook

Hi framers,

I like to trigger to switch to a page (previous or next) by pressing a button. Have tried different things but so far nothing worked out and I couldn't find anything on stackoverflow or here.

This is what I tried e.g.:

myBtn.on Events.Click, ->
....page.snapToPage( pageTwo)

How can I trigger a page event by a click on a button? Many thanks!

5 Comments

Frederic Munch

ah interesting - this works:

myBtn.on Events.Click, ->
....page.snapToPage( pageTwo, false)

unfort. without animation :( this doesn't work:

myBtn.on Events.Click, ->
....page.snapToPage( pageTwo, true)

Any ideas why not? Thanks!

Benjamin Den Boer

Hey Frederic Munch - this is a little bug within the PageComponent that we're aware of and working on. We'll do our best to fix it as soon as possible. Thanks for the heads-up. :-)

Daniel Rakh

Benjamin Den Boer is there any quick workaround? I'm aware of the Utils.delay 0 hack but in my scenario as I add more pages it seems that it re-scrolls all the way from the beginning and causes a quick flicker when I call snapToPage(pageX,true).

Frederic Munch

Benjamin Den Boer Thx - was driving me nuts. Good to know that's a bug ! Daniel Rakhamimov Do you can provide a description for your workaround. Many thx. Even with bug still a great tool!

Daniel Rakh

I was referring to Tisho Georgiev's comment here: https://www.facebook.com/groups/framerjs/permalink/687287008065040/

Read the entire post on Facebook