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
  • 27,721
  • 5
  • 58
  • 81
NuM3
  • 17
  • 5

2 Answers2

0

Use this...

$( document ).scroll(function() {
    alert($( window ).height());
});
Deepu Sasidharan
  • 5,193
  • 10
  • 40
  • 97
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,158
  • 3
  • 23
  • 46