I am using the jquery lazyload plugin. The plugin doesnt work when the page loads. And only work when I click on the Home tab of my website. These are my snippets of my source code.
$(function() {
$("img.lazy").lazyload();
});
document.getElementById(merchantLogoId).innerHTML = ("<img class='lazy' src='img/icon/imageLoading.jpg' data-original="+data.bigImageUrl+">");
Anyone have any idea what could be the problem and a possible workaround for this?
try wrapping it inside document.ready()