‘;
return thumb.replace(“ID”, id) + play;
}
function labnolIframe() {
var iframe = document.createElement(“iframe”);
var embed = “https://www.youtube.com/embed/ID?autoplay=1”;
iframe.setAttribute(“src”, embed.replace(“ID”, this.dataset.id));
iframe.setAttribute(“frameborder”, “0”);
iframe.setAttribute(“allowfullscreen”, “1”);
this.parentNode.replaceChild(iframe, this);
}
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
//alert(“Error”);
}
});
}
//}
var checkView;
clearTimeout(jQuery.data(this, ‘scrollTimer’));
jQuery.data(this, ‘scrollTimer’, setTimeout(function() {
jQuery(“.scroll_post”).each( function() {
checkView = jQuery(this).isInViewport();
if (checkView) {
ChangeUrl(”,jQuery(this).attr(‘post-title’), jQuery(this).attr(‘post-link’));
jQuery(‘.a2a_button_whatsapp’).attr(‘href’,’https://www.addtoany.com/add_to/whatsapp?linkurl=’+encodeURI(jQuery(this).attr(‘post-link’)));
jQuery(‘.a2a_button_facebook’).attr(‘href’,’https://www.addtoany.com/add_to/whatsapp?linkurl=’+encodeURI(jQuery(this).attr(‘post-link’)));
jQuery(‘.a2a_button_facebook’).attr(‘href’,’https://www.addtoany.com/add_to/whatsapp?linkurl=’+encodeURI(jQuery(this).attr(‘post-link’)));
jQuery(‘.a2a_button_twitter’).attr(‘href’,’https://www.addtoany.com/add_to/twitter?linkurl=’+encodeURI(jQuery(this).attr(‘post-link’)));
}
});
}, 250));
});
});
jQuery.fn.isInViewport = function() {
var elementTop = jQuery(this).offset().top;
var elementBottom = elementTop + jQuery(this).outerHeight();
var viewportTop = jQuery(window).scrollTop();
var viewportBottom = viewportTop + jQuery(window).height(); //elementBottom = elementBottom + 200px;
return elementBottom > viewportTop && elementTop