$("body").on("click",".img-list li img",function(e){ layer.photos({ photos: {"data": [{"src": e.target.src}]} }); });