jQuery Waypoints error "notify is not defined"

Buttle Butkus picture Buttle Butkus · Aug 11, 2013 · Viewed 10.4k times · Source

Yes, I know this probably has nothing to do with waypoints. I'm sorry.

I am following this example: http://imakewebthings.com/jquery-waypoints/#get-started

Here is my very simple javascript:

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/includes/js/waypoints/waypoints.min.js"></script>
<script type="text/javascript">
$(document).ready(function(direction) {
$('#example-basic').waypoint(function() {
  notify('Basic example callback triggered.');
});
});
</script>

The scripts are loaded. The jQuery code is pretty much word-for word copied from the example.

And I am getting that error whenever I scroll past element with id 'example-basic'.

I cannot find information on any such "notify" method.

Any ideas?

Answer

Michael B. picture Michael B. · Aug 11, 2013

There is a function defined in index.js as Notify, may be that's all you need

var notify = function(message) {
      var $message = $('<p style="display:none;">' + message + '</p>');

      $('.notifications').append($message);
      $message.slideDown(300, function() {
        window.setTimeout(function() {
          $message.slideUp(300, function() {
            $message.remove();
          });
        }, 2000);
      });
    };