javascript - Magnific popup: getting "The image could not be loaded" and image url is undefined -
i cannot make magnific popup work reason getting "the image not loaded" time. image url "undefined".
<div class="album"> <a href="http://lorempixel.com/1024/768/?a=1"> <img src="http://lorempixel.com/168/168/?a=1" /> </a> <a href="http://lorempixel.com/1024/768/?a=2"> <img src="http://lorempixel.com/168/168/?a=2" /> </a> <a href="http://lorempixel.com/1024/768/?a=3"> <img src="http://lorempixel.com/168/168/?a=3" /> </a> </div> <script> $(function() { $('div.album').magnificpopup({ type: 'image' }); }); </script>
changed code to:
$(function() { $('div.album').magnificpopup({delegate: 'a', type: 'image' }); });
as http://dimsemenov.com/plugins/magnific-popup/documentation.html#initializing_popup
the problem referred container instead of 'a' element contains link image.
Comments
Post a Comment