Triggering jquery event when an element appears on screen

前端 未结 7 1640
难免孤独
难免孤独 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 03:13

    jQuery Waypoints plugin could be useful. It provides a way to trigger an action when an element becomes visible on the screen.

    For instance:

    $('.entry').waypoint(function() {
       alert('The element has appeared on the screen.');
    });
    

    There are some examples on the site of the plugin.

    0 讨论(0)
提交回复
热议问题