ajoslin / angular-scrolly

Fake transform-scrolling with angular-friendly utilities
http://ajoslin.github.io/angular-scrolly
65 stars 7 forks source link

Scroll content always take screen height and not parent height #27

Closed olivierbossel closed 6 years ago

olivierbossel commented 10 years ago

Hi,

First of all, thanks for your work, it's a great plugin.

My question (or issue) is :

I got this as html :

<div id="content" style="height:300px; position:relative;">
   <div scrolly-scroll>
      <!-- a lot of content here (directly in html, not loaded after)... -->
   </div>
</div>

My issue is that the scroll take always the screen height (480px) for scrolling and not the 300px of the parent. So I can't see the content in the 180px of the bottom...

Have you an idea ?

Thanks in advance.

Cheers man !

olivierbossel commented 10 years ago

I've change this line and it seems to work. Not so optimized but for now it's ok for me it seems... I let you check check if this can be a solution for you :

//TODO find a better way to get the height of the wrapper/screen
var screenHeight = elm.parent().height() || $window.innerHeight;

Cheers !