jtrussell/angular-snap.js

Is possible apply Snap only in one section of my page?

Closed this issue · 2 comments

Hello

Is possible apply Snap only in one section of my page?
I have top menu and footer that I don't want to change on toogle. Example code here http://plnkr.co/edit/qOilojtXpCcBm99ynuzQ?p=preview

Thanks

It's doable, here's an example with a fixed footer from a previous thread, Snap still applies to the whole page we're just showing content over it:

http://plnkr.co/edit/Vdz0AZ3tnlfErERmjcrY?p=preview

You can change it to a fixed header by updating the nav element like so:

<nav class="navbar navbar-default navbar-fixed-top" role="navigation"  style="background:red">
    <div class="container">
      Bottom container stuff!
    </div>
</nav>

Just fair warning there are some issues with using fixed position elements, just something to keep in mind.

The snap-content directive should expand to fill it's container, so you may also be able to get something working by wrapping that element in a non-static positioned element. Here's a rough demo.

Thanks!

BTW: Great job :)