0

The website content is dynamic when the user scrolls down the page height changes. What I want is to detect (alert) the current size after each scroll.

Something like $(window).resize() didn't work for me...

Abhitalks
  • 26,843
  • 4
  • 58
  • 80
NuM3
  • 17
  • 5

2 Answers2

0

Use this...

$( document ).scroll(function() {
    alert($( window ).height());
});
Deepu Sasidharan
  • 4,987
  • 8
  • 35
  • 89
0

Try this

 $(function(){
    $(window).load(function(){ // On load
    $('#div').css({'height':(($(window).height()))+'px'});
    });
    $(window).resize(function(){ // On resize
    $('#div').css({'height':(($(window).height()))+'px'});
    });
    });
Mehar
  • 2,048
  • 3
  • 21
  • 44