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?

Ouadie
  • 13,005
  • 4
  • 52
  • 62
peter
  • 143
  • 2
  • 4
  • 10

1 Answers1

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

Community
  • 1
  • 1
Ouadie
  • 13,005
  • 4
  • 52
  • 62