0

I am looking for a method to freeze a vertical scrollbar for a relative div. I cannot seem to find a comparable thread. Fixed position will not work in this instance, as the div is actually a chart from Chap-links-library being used as a fixed axis. I do not have to worry about the mousewheel, as I have reassigned this to control range changes. For spacing and compatibility issues, however, I must display a scrollbar (or the elements fail to properly align). Therefore, I cannot hide. Is there a method of preventing the user from scrolling this div? I do not have to deal with horizontal scroll

laaposto
  • 11,835
  • 15
  • 54
  • 71

1 Answers1

1

If it's just content within the divider that you don't want scrolling, you could use:

$('div#id').scroll(function() {
    $(this).scrollTop(fixedTopValue);
    $(this).scrollLeft(fixedLeftValue);
})

If it's the entire page, just replace 'div#id' with window.

James Donnelly
  • 126,410
  • 34
  • 208
  • 218