Loading iframe content when scrolling and preventing reloading of content
I'm loading an iframe on the page when a user scrolls down the page and hits 500px but the problem I came across is preventing the content from re-loading. Every time you hit the 500 mark, the content re-loads itself. Can anyone tell me how to load it once?
jQuery(document).scroll(function () {
var y = jQuery(this).scrollTop();
if (y > 500) {
jQuery('#loadme').attr('src', '/my-content.html');} });