- my Jquery Code for getting Images and adding ui-li-img tages:
$(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
}
- My Html Code :
<script src="/jquery.fs.zoomer.js"></script>
<div class="zoomer_basic" id="imagesDiv"></div>
And button code:
- Here initial page loding images getting forward,next,zoom controls worked corectly.
- Here i got issue is when i click on button and called buttonClicked() function for loading other images then zoom controls and plugin controls not worked only images showing..and i tried look into fs.zoomer.js but may be old images effecting and how to remove these from plugin.
- used plugins are plugin and fs.zoomer.js
Aucun commentaire:
Enregistrer un commentaire