Created
July 29, 2022 19:20
-
-
Save KustomDeveloper/cef509e8239ca8170cfaec47dc51a7dc to your computer and use it in GitHub Desktop.
Load Video On Click
This file contains hidden or 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
<script> | |
jQuery(function() { | |
jQuery('.video-container').on('click', function(e) { | |
e.preventDefault(); | |
var iframe = j(this).find('iframe'); | |
var url = iframe.attr('data-src'); | |
var srcValue = iframe.attr('src'); | |
if(srcValue == 'about:blank') { | |
iframe.attr('src', url); | |
iframe.css('pointer-events', 'auto'); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment