Toggle button image on click

166 views
Skip to first unread message

Dominic Jacob

unread,
Feb 10, 2016, 7:28:49 AM2/10/16
to Google Web Designer beta
Is it possible to toggle an image by clicking on it while also muting/unmuting audio on a video? Currently the button toggle only works as a 'down' state and as hover.

San Khong

unread,
Feb 10, 2016, 5:18:48 PM2/10/16
to Google Web Designer beta
You can add a click event on the button to mute/unmute the video.

Right click on the button and select Add event...
Event  - Mouse > click
Action - Choose Custom > Add custom action

In the Custom Code dialog, name your function, In this case, you might use a name such as mutebtn. Then use the following code: (note: gwd-video_1 is the id of your video)

if (document.getElementById('gwd-video_1').muted) {
  document.getElementById('gwd-video_1').mute();
}
Reply all
Reply to author
Forward
0 new messages