문제

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?

도움이 되었습니까?

해결책

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);
      });
    };

다른 팁

Notify is a totally separate library from Waypoints (!!), I just realized this myself. You need to have notify included, along w JQuery, it is not a built in function to JQuery or JavaScript:

http://notifyjs.com/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top