开发者

How do I use the jQuery, Waypoints extension on a Click Event?

开发者 https://www.devze.com 2023-03-24 17:19 出处:网络
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:

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

精彩评论

暂无评论...
验证码 换一张
取 消