我试图实现基于滚动的动画。我的意思是,当某个div出现在视图中时,我想让它的内容变成动画。为了实现这一点,我已经给出了硬编码值,如
if($(window).scrollTop() > 700)
如果一个页面上有这么多的部分,那么对于所有这些部分,我将不得不给出硬编码值。
是否有一种方法来检测一个特定的div是否在视图中?
这是我的HTML, CSS和JS。
我试图实现基于滚动的动画。我的意思是,当某个div出现在视图中时,我想让它的内容变成动画。为了实现这一点,我已经给出了硬编码值,如
if($(window).scrollTop() > 700)
如果一个页面上有这么多的部分,那么对于所有这些部分,我将不得不给出硬编码值。
是否有一种方法来检测一个特定的div是否在视图中?
这是我的HTML, CSS和JS。