hello,
this solution Stop Ajax Timer on DIV scroll up using jQuery in ASP.Net
It's not working as expected, it's giving bug kindly check
I have master page and content page project
These are things should work perfectly
1. By default on timer event the panel should remain on bottom
2. When user try to scroll up panel so user can see upward message
3. But when user again keep the panel to bottom to see last message then
4. Again panel should remain on bottom
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function ScrollPanelBottom() {
var text = $('.container');
text.scrollTop(text[0].scrollHeight);
};
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
var text = $('.container');
text.scrollTop(text[0].scrollHeight);
}
});
};
$(function () {
$('.container').on('mousedown', function (e) {
$('#hfX').val(event.pageX);
});
$('.container').on('mouseup', function (e) {
if (parseInt($('#hfX').val()) >= e.pageX) {
var timer = $find('<%=timer.ClientID %>');
timer._stopTimer();
}
});
$('.container').on('mousewheel', function (e) {
var timer = $find('<%=timer.ClientID %>');
if (e.originalEvent.wheelDelta >= 0) {
timer._stopTimer();
} else {
timer._startTimer();
}
});
$('.content').on('mousedown', function (e) {
e.stopPropagation();
});
});
</script>