0

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?

3
  • 1
    "A picture says more than thousand words." Can you post a link to jsfiddle example or post your source code? Commented 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 ? Commented Apr 29, 2013 at 9:39
  • 1
    @Paw Cabelin, sounds more like "I have read and I accept the rules"... Commented Apr 29, 2013 at 9:43

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.