how to detect if the end of horizontal scrollbar is reached? [duplicate]
This question already has an answer here:
How do I get the max value of scrollLeft?
8 answers
I have a div wich is scrollable horizontally. I want to know when I reach the end of it.
Is there is simple way to detect if the horizontal scrollbar is scrollable to one direction or the other?
javascript
marked as duplicate by raina77ow
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 13:39
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How do I get the max value of scrollLeft?
8 answers
I have a div wich is scrollable horizontally. I want to know when I reach the end of it.
Is there is simple way to detect if the horizontal scrollbar is scrollable to one direction or the other?
javascript
marked as duplicate by raina77ow
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 13:39
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27
add a comment |
This question already has an answer here:
How do I get the max value of scrollLeft?
8 answers
I have a div wich is scrollable horizontally. I want to know when I reach the end of it.
Is there is simple way to detect if the horizontal scrollbar is scrollable to one direction or the other?
javascript
This question already has an answer here:
How do I get the max value of scrollLeft?
8 answers
I have a div wich is scrollable horizontally. I want to know when I reach the end of it.
Is there is simple way to detect if the horizontal scrollbar is scrollable to one direction or the other?
This question already has an answer here:
How do I get the max value of scrollLeft?
8 answers
javascript
javascript
asked Nov 15 '18 at 13:12
Ic3m4nIc3m4n
8719
8719
marked as duplicate by raina77ow
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 13:39
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by raina77ow
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 13:39
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27
add a comment |
1
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27
1
1
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27
add a comment |
1 Answer
1
active
oldest
votes
To check the horizontal scrollbar you need to use
var scrollLeft = $('#div_id').scrollLeft();
You can then check if it's equal to the $('#div_id').width() and there's the end.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To check the horizontal scrollbar you need to use
var scrollLeft = $('#div_id').scrollLeft();
You can then check if it's equal to the $('#div_id').width() and there's the end.
add a comment |
To check the horizontal scrollbar you need to use
var scrollLeft = $('#div_id').scrollLeft();
You can then check if it's equal to the $('#div_id').width() and there's the end.
add a comment |
To check the horizontal scrollbar you need to use
var scrollLeft = $('#div_id').scrollLeft();
You can then check if it's equal to the $('#div_id').width() and there's the end.
To check the horizontal scrollbar you need to use
var scrollLeft = $('#div_id').scrollLeft();
You can then check if it's equal to the $('#div_id').width() and there's the end.
answered Nov 15 '18 at 13:17
Robert ŞtefanRobert Ştefan
12
12
add a comment |
add a comment |
1
Math.abs(el.scrollLeft) === el.scrollWidth - el.clientWidth
– raina77ow
Nov 15 '18 at 13:16
thank you @raina77ow that works for me
– Ic3m4n
Nov 15 '18 at 13:27