【发布时间】:2014-08-27 14:24:29
【问题描述】:
如果我想在元素滚动up 进入视野时立即触发航路点怎么办?当您向下滚动时,我有一个航点发生。这很好用。但我希望元素滚动回视图(屏幕底部的元素顶部)后立即触发另一个航路点。
$(".picture").waypoint(function(direction){
var $this = $(this);
if (direction === "down") {
setTimeout(function()
{
$this.children('.cutline_background').animate({"left":"0px"},2500, function(){});
$this.children('.text').animate({"left":"40px"},2500, function(){});
}, 3000);
}
}, {offset: 0 });
$(".picture").waypoint(function(direction){
var $this = $(this);
if (direction === "up") {
$this.children('.cutline_background').css("left", "-20%");
$this.children('.text').css("left", "-20%");
}
}, {offset: '90%' }); //this doesn't seem to be working
【问题讨论】:
-
在这里,我用你的方法创建了一个jsfiddle - 有什么问题?
-
我猜它似乎不适用于我的网站。也许还有另一个原因。谢谢!
标签: jquery offset jquery-waypoints