Home › Forums › JavaScript › Waypoint find next div › Reply To: Waypoint find next div
December 12, 2014 at 5:39 pm
#190701
Participant
Well you’ve got a scoping problem I’d say.
Declaring var next =...
inside a function sticks it into the scope of said function. That means it can’t be accessed outside of the function it was declared.
What I’d do is return the value of next
in the function so it can be passed as an object to another.