rochal / jQuery-slimScroll

small jQuery plugin that transforms any div into a scrollable area with a nice scrollbar. Demo and more:
http://rocha.la/jQuery-slimScroll
2.23k stars 928 forks source link

Adds the new option 'heightIgnoreClass' to manage more complex layout… #288

Open moonClimber opened 6 years ago

moonClimber commented 6 years ago

… (with other elements between current scroll element and its parent)

it would be useful to integrate this new option to manage more complex layout. Here is my case

<div id="mainContainer">
  <div id="otherElement1" class="listScrollIgnore">any content...</div>
  <div id="otherElement2" class="listScrollIgnore">any content...</div>
  <div id="elementToScroll" class="listScrollIgnore">my list</div>
</div>

By calling

$('#elementToScroll').slimScroll({
        height:'auto',
        heightIgnoreClass: 'listScrollIgnore'
    });

everything works fine since the outerHeights of otherElement1 and otherElement2 are ignored.