May You all Blessed Today!
I wanna ask something about how to detect scrolling event when we finally reach the bottom of the Iframe. I've been trying out some jQuery code that I saw in these stackoverflow's post here and here, but nothing can do the job. So, let's cut the bull, here's my html :
<div class="wrapper-1">
<div class="wrapper-2">
<iframe id="iframec" class= "content-iframe" data-src="https://en.wikipedia.org/wiki/Tokyo" src="https://en.wikipedia.org/wiki/Tokyo" loading="lazy"></iframe>
</div>
</div>
And here's the jQuery code, I tried :
CODE 1 :
$(function() {
$("#iframec").load(function() {
var iframe = document.getElementById("iframec").contentWindow;
$(iframe).scroll(function() {
if($(iframe).scrollTop()==$(iframe).height()-$("#iframec").height()) {
alert("Reached bottom!");
}
});
});
})
CODE 2 :
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) alert('Bottom reached');
});
I know it seems so easy to you, but I'm very new in jQuery. So, please help me out guys. Thanks A Lot guys.