<script src="waypoint.js"></script>
$("#thing").waypoint( function( direction ) { // do something
},{offset:100%});
其中 #thing 是用来参考的对象;offset是这个参考对象离窗口 最上边 的距离,可以是百分比,也可以是像素值。上边参数的意思是当#thing出现在屏幕最下方时,触发事件。
例子:
$('.scrollpoint.sp-effect1').waypoint(function(){$(this).toggleClass('active');$(this).toggleClass('animated fadeInLeft');},{offset:'100%'});