i trying run script ..a slider url # , name of slider button "slide_8". when clicks on youtube video pops out. in script below video playing cannot seens anywhere on browser. have kept youtube url inside javascript.
<div class="overlay" style="display: none;"></div> <div class="propose-video-wrap" style="display: none;"> <div id="propose_video"></div> </div> <script type="text/javascript"> $('#slide_8').click(function() { var video_htm = '<a class="pop-close-btn" onclick="closevideopopup();"></a> <iframe id="propose_video_iframe" width="300" height="150" src="//www.youtube.com/embed/sqtxj15vzou?rel=0&autoplay=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'; $('#propose_video').html(video_htm); $('.overlay').css('display', 'block'); $('.propose-video-wrap').css('display', 'block'); $('body').css('overflow-y', 'hidden'); }); function closevideopopup() { $('.overlay').css('display', 'none'); $('.propose-video-wrap').css('display', 'none'); $('#propose_video').html(''); $('body').css('overflow-y', ''); } </script>
i pasted code in jsfiddle, added button , works. changes i've made adding event listener clicking on closing button, because reason inline didn't work on jsfiddle, inserting text inside closing button, it's possible click it.
it's possible issue styles, example of elements has negative z-index or positioned in weird way. disable display: none
attribute , insert text inside html elements first , see end up.
if you'd see ended with, here is.
Comments
Post a Comment