Open kmturley opened 8 years ago
Can you add support for passing through a custom element which has overflow-y: scroll?
It could be passed through like this:
element: document.getElementById('main')
ng-ScrollSpy.js line could have:
.value('config', { 'offset': 200, 'delay': 100, 'element': window })
And a new refresh position function:
'refreshPositions': function() { this.position.documentHeight = Math.max(config.element.scrollHeight, config.element.offsetHeight, config.element.clientHeight); if (config.element.pageYOffset) { this.position.windowTop = config.element.pageYOffset; } else if (config.element.scrollTop) { this.position.windowTop = config.element.scrollTop; } else { this.position.windowTop = (document.documentElement || document.body.parentNode || document.body).scrollTop; } this.position.windowBottom = this.position.windowTop + window.innerHeight }
I've posted an example script here: https://gist.github.com/kmturley/043cd096a0e8239bea18
:+1:
Can you add support for passing through a custom element which has overflow-y: scroll?
It could be passed through like this:
ng-ScrollSpy.js line could have:
And a new refresh position function:
I've posted an example script here: https://gist.github.com/kmturley/043cd096a0e8239bea18