My code can detect browser window bottom like below and then run last_msg_funtion(); :
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
last_msg_funtion();
}
});
My problem is user need to scroll down until bottom(footer) then last_msg_funtion(); will run but i want adjust the detection maybe around 30% from bottom
See image below :

My Site : Click Here
Full Code : Click Here
Try this:
Note the
* 0.7will mean that the function will fire when the scroll is 70% of the way down the page – ie. 30% from the bottom.