Swipeable Gallery Event (Hide/Show)

83 views
Skip to first unread message

Laan

unread,
Jan 12, 2016, 4:16:46 AM1/12/16
to Google Web Designer beta
Hi,

I'm trying to add an event to a Custom swipeable gallery. 
The idea is to hide an object on the canvas depending on which frame is active.

var frameId = event.detail.id;
if (frameId == 1) {
  alert('frame 1');
  $('#test').hide();
} else {
  alert("Frame 2");
}

The alert function is working correct, but the part trying to hide the object on the canvas is not working. 


Skärmavbild 2016-01-12 kl. 10.08.41.png

rika

unread,
Jan 12, 2016, 6:02:07 PM1/12/16
to Google Web Designer beta
Hi Laan,

Please take a look at the sample file attached.
The code you provided above seems to be working so the error must be somewhere else.

Thanks,
Rika
(GWD team)
gwdbeta-vDSbaILlOU.zip

Laan

unread,
Jan 13, 2016, 2:01:04 AM1/13/16
to Google Web Designer beta
Hi Rika, 
Thanks for your response. And I've looked at your file and everything seems to be working in your document, and i've tried to replicate it in a new document. But still no luck.
I've attached my document.


test-2.zip

Laan

unread,
Jan 13, 2016, 3:29:43 AM1/13/16
to Google Web Designer beta
I found the answer, I've forgotten to add the jquery string:  <script src="assets/jquery-2.2.0.min.js"></script>
I just assumed that the jquery was included in the GWD.

Thanks for your help, it was most helpful!

rika

unread,
Jan 13, 2016, 1:08:30 PM1/13/16
to Google Web Designer beta
Glad it worked!  Thanks for letting us know.
Reply all
Reply to author
Forward
0 new messages