Skip to content

Instantly share code, notes, and snippets.

@simplelife7
Created July 9, 2013 01:47
Show Gist options
  • Select an option

  • Save simplelife7/5954021 to your computer and use it in GitHub Desktop.

Select an option

Save simplelife7/5954021 to your computer and use it in GitHub Desktop.

Revisions

  1. simplelife7 created this gist Jul 9, 2013.
    4 changes: 4 additions & 0 deletions visible_area.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    var a = document.getElementById("eq").offsetTop;
    if (a >= $(window).scrollTop() && a < ($(window).scrollTop()+$(window).height())) {
    alert("div在可视范围");
    }