How do I use the jQuery, Waypoints extension on a Click Event?
I'm reading the documentation here: jQuery, 开发者_如何学编程Waypoints, plugin docs.
And I'd like to refresh the waypoints using this jQuery object extension on a click event:
$.waypoints('refresh')
How do you do that?
Click-event on what?
Suppose you add a button to the page:
<button id="refreshWaypointsBtn" type="button">Refresh the waypoints.</button>
Then you'd activate it like so:
$("#$refreshWaypointsBtn").click ( function () {
$.waypoints ('refresh');
} );
$('#$refreshWaypointsBtn').on('click', function() {
Waypoint.refreshAll();
});
精彩评论