视差开启和关闭照片

时间:2012-12-18 18:11:18

标签: javascript jquery animation parallax

我在一个使用视差的网站上工作 - 我有一张照片,我在垂直方向切成两半,当你向下滚动时,它会分开。换句话说,没有迹象表明在您滚动之前照片将“打开”。这是我的代码:

    $("#section5_back5").stop().animate({ right : (520 * object_speed * 1.8) + (scroll_position * object_speed)}, delay);
    $("#section5_back5").stop().animate({ top : (-50 * object_speed2) + (scroll_position * object_speed2)}, delay);
    $("#section5_back6").stop().animate({ left : (545 * object_speed * 1.8) + (scroll_position * object_speed)}, delay);
    $("#section5_back6").stop().animate({ top : (-50 * object_speed2) + (scroll_position * object_speed2)}, delay);
}

有没有办法在到达照片底部后将照片“关闭”约100px?

0 个答案:

没有答案