How to check if an element is in the view of the user with jquery

前端 未结 6 749
孤街浪徒
孤街浪徒 2020-11-30 04:28

I have a very big draggable div in my window. This div has a smaller window.

6条回答
  •  孤城傲影
    2020-11-30 04:47

    have a look at this plugin

    It give's you the option to do the following selectors

    $(":in-viewport")
    $(":below-the-fold")
    $(":above-the-top")
    $(":left-of-screen")
    $(":right-of-screen")
    

提交回复
热议问题