【问题标题】:Add animations and effects when div enters visibilitydiv进入可见性时添加动画和效果
【发布时间】:2019-02-26 00:00:34
【问题描述】:

我想让页面上的文本像mfpins.com 一样跳转/淡入。我已经考虑在 div 与顶部有一定距离时添加类,但是,我确信有一种更有效的方法(最好使用 jQuery)。效果是仅在第一次滚动到视图时发生还是每次都发生对我来说并不重要。

谢谢!

【问题讨论】:

    标签: javascript jquery html scroll jquery-animate


    【解决方案1】:

    您可以使用像 waypoints 这样的 jQuery 插件。

    例如:

    var waypoint = new Waypoint({
        element: document.getElementById('waypoint'),
        handler: function(direction) {
            console.log('Scrolled to waypoint!')
        }
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-25
      • 2011-05-01
      • 1970-01-01
      相关资源
      最近更新 更多