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...
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...
Use this...
$( document ).scroll(function() {
alert($( window ).height());
});
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'});
});
});