jQuery code:
$(window).load(function(){
$("#slider").flexslider({
animation: "slide",
controlNav: false,
directionNav: false,
init: function (slider) {
// lazy load
$("img.lazy").slice(0,1).each(function () {
alert('init running');
var src = $(this).attr("data-src");
$(this).attr("src", src).removeAttr("data-src").removeClass("lazy");
});
},
before: function (slider) {
// lazy load
$("img.lazy").slice(0,2).each(function () {
alert('before running');
var src = $(this).attr("data-src");
$(this).attr("src", src).removeAttr("data-src").removeClass("lazy");
});
},
animationLoop: false,
slideshow: false,
sync: "#carousel",
})
})
JSFIDDLE URL:
https://jsfiddle.net/6z5L31tg/
init function is not working. even it not alerting me. can you please explain to me why it not working? and How can I resolve this issue? I am weak in English. please apologize me if I made any Grammatical or Spelling mistakes.