Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery waypoint is not working

Tags:

jquery

As per my code written below I think when I scroll to the .onscrollActivate div alert should come. But it is not giving me the alert.

<div class="waypoint" style="width:100%;height:300px;"></div>

$(document).ready(function(){
    $('.onscrollActivate').waypoint(function() {
    alert();
  });
});

If I try .click() instead, it gives me the alert message.so my jquery is fine.

So, where am I going wrong?

like image 902
Kiran Dash Avatar asked Jul 03 '15 05:07

Kiran Dash


1 Answers

As you see waypoint is not a function error in console, you haven't loaded the waypoint library on your page.

Include waypoint js on the page after jQuery.

<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.5/waypoints.min.js"></script>
like image 148
Tushar Avatar answered Sep 18 '22 11:09

Tushar