imakewebthings / waypoints

Waypoints is a library that makes it easy to execute a function whenever you scroll to an element.
http://imakewebthings.com/waypoints/
10.38k stars 1.34k forks source link

not able to initialize sticky #538

Open lschneiderman opened 8 years ago

lschneiderman commented 8 years ago

I'm sure this is a simple problem, but I'm pulling my hair out.

I'm trying to make the element.subheads_wrapper sticky on my page.

I've put the latest waypoints files under Inetpub\wwwroot\includes\waypoints-master.

My page is in Inetpub\wwwroot\mypage\index.php

In the header, I've attached the proper files I think:

<script src="../includes/waypoints-master/lib/jquery.waypoints.min.js"></script>
<script src="../includes/waypoints-master/lib/shortcuts/sticky.min.js"></script>

css:

.stuck {
  position:fixed;
  top:0;
}

jquery:

var sticky = new Waypoint.Sticky({
     element: $('.subheads_wrapper')[0]
});

But I keep getting the error:

Waypoint.Sticky is not a constructor

What am I doing wrong?

ryadkarar commented 7 years ago

Same problem here! :(

ianaisa25 commented 6 years ago

Just paste or type the code to the sticky.js file.