Last active
December 25, 2015 07:29
-
-
Save jramsahai/6939304 to your computer and use it in GitHub Desktop.
I was asked to provide the code to launch the lightbox from a hyperlink. There was some interesting conversation on http://stackoverflow.com/questions/688196/how-to-use-a-link-to-call-javascript so I went with this.
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
<html> | |
<head> | |
<script type="text/javascript" id="vidyard_embed_code_XXXXXXXXXXX" src="//play.vidyard.com/XXXXXXXXXXX.js?v=3.1&type=lightbox"></script> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var a = document.getElementById("videoLink"); | |
a.onclick = function() { | |
fn_vidyard_XXXXXXXXXXX(); | |
/* Where XXXXXXXXXXX is the UUID of the player. If the UUID contains a '-' | |
(e.g. XXXXXX-XXXXX) replace it with a '$' in the function call | |
(e.g. fn_vidyard_XXXXXX$XXXXX();) */ | |
return false; | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<a id="videoLink" href="">Click here to launch the player in a lightbox!</a> | |
<!-- This will also work but is considered bad form --> | |
<!-- | |
<a onclick="fn_vidyard_XXXXXXXXXXX();" href="javascript:void(0);">Launch the player!</a> | |
--> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment