jQuery Waypoints Error: The sticky method does not exist

Simone picture Simone · Jan 11, 2013 · Viewed 7k times · Source

I want to stick an element to the top of the page in WordPress, using jQuery Waypoints plugin.

<script src="path/to/waypoints.min.js"></script>
<script>
  $('#myelement').waypoint('sticky');
</script>

But the console says:

Error: The sticky method does not exist in jQuery Waypoints.

Am I missing something?

Answer

saschoar picture saschoar · Jan 11, 2013

Did you include the sticky shortcut script on top of your normal waypoints.js?

<script src="path/to/waypoints.min.js"></script>
<script src="path/to/waypoints-sticky.min.js"></script>

See Sources and Docs