yads / ngTinyScrollbar

An angular directive port of the TinyScrollbar
MIT License
55 stars 20 forks source link

Auto Height Issue with Scrolling #9

Closed mikehuebner closed 9 years ago

mikehuebner commented 9 years ago

Hello!

I just started using your plugin and I'm trying to get it implemented to my project. I am having an issue with scrolling though. I have a sidebar container and a main container, both of which are having overflow issues with their scrolling. For the sidebar I tried to make it not auto, but just update the height like so:

function link (scope, element, attr) {
            var overview = angular.element(element[0].querySelector('.scroll-overview')),
                overviewHeight = overview[0].offsetHeight,
                sidebar = angular.element(element[0].querySelector('.sidebar'));
                sidebar.css('height', overviewHeight / 2 + 'px');
        }

Basically just sets the height to the height of the elements, this somewhat works but causes the scrollbar to set its own height to 0 and hide it as well. No idea why this is happening and I don't know how to get a more dynamic scroll bar. I'm going to be trying different solutions but this one got me the closest to what I wanted. Any help is appreciated and if there is a way I can help figure out this issue for others let me know!

yads commented 9 years ago

Take a look at issue #2. Would that solve your issue of the scrollbar height going to 0?

yads commented 9 years ago

Closing due to no update.