如果你在下面看,我在偏移量 -185 处添加了几个类,当你向下滚动时,两个是动画/淡入的。当您向上滚动超过偏移量时,我希望栏淡出,但我无法实现这一点。我正在使用 jQuery 航点脚本http://imakewebthings.com/jquery-waypoints/
$('#wrapper').waypoint(function(event, direction) {
$('#scroll-action').toggleClass('hidden', direction === "up");
}, {
offset: -185
}).find('#scroll-action').waypoint(function(event, direction) {
$('#scroll-action').removeClass('hidden');
$(this).parent().toggleClass('sticky', direction === "down");
$('#scroll-action').addClass('animated fadeIn');
event.stopPropagation();
}, {
offset: -185
});