$(document).ready(function() {
$.ajax({
url: "localpath/folder/",
success: function(data){
$(data).find("a:contains(.jpg)").each(function(){
var images = $(this).attr("href");
Array.push(images);
});
$('<ul id="imgul" />').appendTo('#imagesDiv');
//here create dynamic ui-li-ima tage append to div
for(var i=0;i<Array.length;i++)
{
$('<li>').append($('<img class=""img-responsive/>').attr('src',"herepath" )).appendTo('#imgul');
}
});
$(".demo .zoomer_basic").zoomer();// call plugin
});
function buttonClicked(){
$("#imagesDiv").empty();
$(".demo .zoomer_basic .zoomer_tiled").empty();
$.ajax({
url: "localpath/folder-1/",
success: function(data){
$(data).find("a:contains(.jpg)").each(function(){
var images = $(this).attr("href");
Array.push(images);
});
$('<ul id="imgul" />').appendTo('#imagesDiv');
for(var i=0;i<Array.length;i++)
{
$('<li>').append($('<img class=""img-responsive/>').attr('src',"herepath" )).appendTo('#imgul');
}
});
$(".demo .zoomer_basic").zoomer();//recall plugin
}
<script src="/jquery.fs.zoomer.js"></script>
<div class="zoomer_basic" id="imagesDiv"></div>
按钮代码: