/* Script to close video popup modal */ <script> $(function() { $('.open-modal').click(function() { $('.modal').fadeIn(); $('.modal-background').fadeIn(); e.stopPropagation(); }); $('.close-modal').click(function() { $('.modal').fadeOut(); $('.modal-background').fadeOut(); }); $('.modal-background').click(function() { $('.modal').fadeOut(); $('.modal-background').fadeOut(); }); $(document).keydown(function (event) { if (event.keyCode == 27) { $('.modal').fadeOut(); $('.modal-background').fadeOut(); } }); }); </script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter