Triggering jquery event when an element appears on screen

前端 未结 7 1692
难免孤独
难免孤独 2020-12-05 02:41

I want to show a fade effect as soon as the element appears on screen. There is a lot of content before this element so if I trigger the efect on document.ready, at certain

7条回答
  •  忘掉有多难
    2020-12-05 02:54

    A quick search turned up this viewport extension for jQuery that will allow you to check an element's visibility in the viewport. If your element is not in the viewport, don't do your fade-in animation.

提交回复
热议问题