Swipeble Gallery Events

85 views
Skip to first unread message

rrho...@gmail.com

unread,
Nov 10, 2016, 5:00:29 PM11/10/16
to Google Web Designer beta
There has been quite a few posts requesting a method within a swipeable gallery or carousel gallery component to show a click box or button, etc. for each image in the gallery as users navigate through the gallery. The idea is for a user to progress through the images and be able to either tap on the image in the gallery, or tap on a button and be taken to further details of that image on a separate GWD page. While I've found processes through this forum to display unique text for each image as the user navigates the gallery, I have not yet found the right method to display a button/tapable area/etc to allow the user to tap and progress to another page. If anyone in the GWD universe has the answer, or even a work around to help me make this happen, I would greatly appreciate it. I've read that it's been added to a feature request, but I've also seen some conflicting concepts that make me believe it is possible in the current release. Either way, a definitive answer would be super awesome right now.

Please help if you know! Thanks a million! - Ryan

San Khong

unread,
Nov 16, 2016, 2:09:33 PM11/16/16
to Google Web Designer beta
You can use custom actions to achieve this.  

Right click on the gallery and select Add event...
Select Swipeable Gallery > Frame tap event
Select Custom > Add custom action
In the custom action, have something like this:
var gallery = document.getElementById('gwd-swipegallery_1');
if (gallery.currentIndex == 1) {
  gwd.actions.gwdPagedeck.goToPage('pagedeck', 'page1_1', 'none', 1000, 'linear', 'top');
} else if (gallery.currentIndex == 2) {
  gwd.actions.gwdPagedeck.goToPage('pagedeck', 'page1_2', 'none', 1000, 'linear', 'top');
}

I've included my test file so you can check it out also.

Hope it helps.
San
Google Web Designer team
imageTaptoPage.zip

rrho...@gmail.com

unread,
Dec 22, 2016, 3:32:01 PM12/22/16
to Google Web Designer beta
San Khong! You're the man! Finally got around to testing this and it worked after a few trials. Thanks a million dude! Happy Holidays to you, yours, and the Google Web Designer Team!
Reply all
Reply to author
Forward
0 new messages