1

I need a jquery function that executes when I scroll by a certain point. I got a page with multiple blog-posts. When I scroll by each post, an ajax request should be sent.

Since the blog-posts is different lengths, I can't have a specific position, it needs to be executed when scrolling by e.g the title of the post.

Like this.

<div>Post
<div onScrollBy="ajax();">Title</div>
<div>Description</div>
</div>

<div>Post
<div onScrollBy="ajax();">Title</div>
<div>Description</div>
</div>

<div>Post
<div onScrollBy="ajax();">Title</div>
<div>Description</div>
</div>

I just have no clue how to make this "onScrollBy" attribute, or if there is any other solution.

Thanks.

PVP Squad
  • 11
  • 5
  • Possible duplicate of [How to determine when an HTML5 element has been viewed?](https://stackoverflow.com/questions/20827523/how-to-determine-when-an-html5-element-has-been-viewed) – Davide Vitali Mar 31 '19 at 11:56

0 Answers0