Category Archives: jQuery Photo Gallery Tutorial

Dynamically edit HTML5 Gallery play list

Question:

I was using your product today. I found it very interesting . However I have noticed the images and videos added  dynamically to the div tag hosting the plugin do not get rendered. The div tag shows blank.

Answer:

You can view this tutorial: http://html5box.com/html5gallery/initialize.php

The idea is, do not add the class name html5gallery to the div, use an id instead. Like following:

<div id="mygallery1" data-skin="gallery" data-width="480" data-height="270" style="display:none;"></div>

Then every time you dynamically update the playlist, you can call the JavaScript function to re-initialise the gallery and reload the images/videos list:

$("#mygallery1").html5gallery();