您的位置:首页 > Web前端 > JavaScript

waypoints.js

2016-03-24 11:16 696 查看
<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%'});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: