I’m learning JS and I would like to make a button appear after 10min 11sec of my video hosted on Wistia.
After doing some research on the forum, I came across this post. Presumably the person was in the same situation as me. However, after trying this script, it doesn’t work.
#mybutton {
opacity: 0; // initially hide the button
}
.ShowMebutton{
opacity: 1; // show me the button!
}
So the button is hidden at start.
And used this code for JS :
<script>
window._wq = window._wq || [];
// target our video by the first 3 characters of the hashed ID
_wq.push({ id: "29b0fbf547", onReady: function(video) {
// at 300 seconds (5min x 60 = 300), do something amazing
video.bind('secondchange', function(s) {
if (s === 10) {
// Insert code to do something amazing here
// console.log("We just reached " + s + " seconds!");
$( "#mybutton" ).addClass( "ShowMeButton" );
}
});
}});
</script>
Normally, after 10 seconds, the button is supposed to show. But it is not the case.
Not sure where you are placing your CSS is but you can’t add CSS inside HTML without a <style> element. Also, // is not a valid CSS comment use /* comment */