w11k / angular-sticky-things

Sticky Directive for Angular 2+

Home Page:https://w11k.github.io/angular-sticky-things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sticky to the component bottom?

wisespace-io opened this issue · comments

Is it possible sticky to the bottom using this component? I have a sidebar, so when the user reaches to the bottom of the
sidebar, the bottom edge should stay stuck to the bottom of the browser window.
Similar effect the second example "Scrollable Sticky Element" on this page: https://abouolia.github.io/sticky-sidebar/#examples.
Observe that the red column on the left stops scrolling when its bottom edge is reached.

Hello wisespace-io, yes you can define a section as a boundary for your sidebar like so

<section class="color-1" #boundary1>
  <div class="container wrap">
    <div class="row">
      <div class="col-6">
        <div #spacer1></div>
        <nav id="your sidebar" stickyThing="" [spacer]="spacer1" [boundary]="boundary1">
          <ul>
            <li>Home</li>
            <li>...</li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</section>