var elementBoundary = el.getBoundingClientRect();
                  
                  
                  
                  
                  
                          var top = elementBoundary.top;
                  
                  
                          var bottom = elementBoundary.bottom;
                  
                  
                          var height = elementBoundary.height;
                  
                  
                  
                  
                  
                          return ((top + height >= 0) && (height + window.innerHeight >= bottom));
                  
                  
                      }
                  
                  
                  
                  
                  
                      function isFullyVisible(el) {
                  
                  
                          var elementBoundary = el.getBoundingClientRect();
                  
                  
                  
                  
                  
                          var top = elementBoundary.top;
                  
                  
                          var bottom = elementBoundary.bottom;
                  
                  
                  
                  
                  
                          return ((top >= 0) && (bottom <= window.innerHeight));
                  
                  
                      }
                  
                  
                
эх, молодость вспомнил.. одна из самых первых задач которые я решал на js
Обсуждают сегодня