-1

有人可以说是怎么回事吗?起初我已经加载了 jQuery Waypoints ( http://imakewebthings.github.com/jquery-waypoints/ ) 然后在文本之后包含了你可以看到的代码。向下滚动页面时,我需要对图像产生淡入淡出效果,但根本没有发生任何事情。我在 Stack Overflow 上找到了这个解决方案 -当用户滚动到该 div 时,JQuery 淡入一个 div 这是我试图做我的解决方案的链接 - http://layot.prestatrend.com 谢谢!

// by default your element will be hidden
$('.ajax_block_product').hide();
// call waypoint plugin
$('.ajax_block_product').waypoint(function(event, direction) {
    // do your fade in here
    $(this).fadeIn();
}, {
   offset: function() {
       // The bottom of the element is in view
       return $.waypoints('viewportHeight') - $(this).outerHeight();
    }
});
4

1 回答 1

0

jQuery hide 函数设置display:none在一个元素上。元素display:none不报告正确的offset. 尝试最初将不透明度设置为 0 或将可见性设置为隐藏。

于 2012-02-06T01:12:41.677 回答