I have a div which is scrollable using the overflow-y set to auto. What I want to do is that beneath this div I like to have a simple button which is disabled and I like it to be enabled after I reached the bottom of the div.
Can this be achieved?
-
1"A picture says more than thousand words." Can you post a link to jsfiddle example or post your source code?Reporter– Reporter2013-04-29 09:31:39 +00:00Commented Apr 29, 2013 at 9:31
-
are you trying to say you want to have a Back to top-button? or Top of page-button ?Þaw– Þaw2013-04-29 09:39:02 +00:00Commented Apr 29, 2013 at 9:39
-
1@Paw Cabelin, sounds more like "I have read and I accept the rules"...linepogl– linepogl2013-04-29 09:43:08 +00:00Commented Apr 29, 2013 at 9:43
Add a comment
|
1 Answer
try this with jquery:
$("#idDiv").scroll( function() {
if($(this)[0].scrollHeight - $(this).scrollTop() == $(this).outerHeight())
// what you want to do ...
$('#idButton').removeAttr('disabled');
}
}
see this : javascript: detect scroll end