Last active
August 29, 2015 14:02
-
-
Save gerbenvandijk/dbb881b56fd22b5f2482 to your computer and use it in GitHub Desktop.
Initiate play event on click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery version - we use the .on() function to make sure we can also run the function on dynamically inserted elements. | |
$(document).on("click", "a.playbtn", function (e) { | |
var video = $(document).find('#intro-video')[0]; // Find the video element to play | |
video.play(); // play the video, simple innit? | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment