Show html5 tag in colorbox shortcut

I am trying to render HTML5 using colorbox lightboxes. The way I do it looks something like this:

var html ='<video>'+sources+'</video>'; $.colorbox({html:html}); 

where sources is a variable that contains the html of the source tags. My problem is that even when the colorbox shortcut appears, the video does not display. I checked with Firebug and all the html is there. Any idea why this might not seem like?

Thanks.

+4
source share
1 answer

You can display it using the built-in html mode

 $( document ).ready( function() { $( '#openColorbox' ).colorbox( { inline : true, width : '80%', height : 'auto', href : '#inlinevideocontent' } ); } ); 

and here is your inline div

 <div style='display:none'> <div id='inlinevideocontent' > <video controls="controls" src="video.mp4" /> </div> </div> 
+5
source

Source: https://habr.com/ru/post/1390875/


All Articles