I have implement lighgallery plugin to my local site... and this is not working with dom elements ...
for example
1.) append dom element created with js to html code..
if i create something like this in js "<span id='imgcon'><a href="image"><img src="image"></a></span>"
and this all code is in a varialbe lets call galleryview (var galleryview
) and this variable i append to a div that is in html file <html><head></head><bdy><div class="container"></div></bdy></html>
and append like this from js file code $(".container").append(galleryview);
and in end i use this $(".imgcon").lightGallery();
does not work...
Here is jsfiddle demo not working with dom
2.) images are in html code
i have html code smthing like this <html><head></head><bdy><div class="container"><span class="imgcont"><a href="image"><img src="image"></a></span></bdy></html>
This works fine as it.$(".imgcon").lightGallery();
Here is jsfiddle working demo without dom.
Question : why i cannot use dom with lightgallery ?
First demo is not working becasue i use js dom and second demo is working because i use html code in html file.. or there any problem with my code..