Sean Lafferty
Sean Lafferty

Reputation: 171

How to stop twitter bootstrap scrollspy at a certain distance?

Hey Im using bootstrap's scrollspy to have a sidenav move with my content. The problem is I have a massive footer and when the user keeps scrolling past the main body content, the sidenav keeps scrolling and overlaps the footer. Is there an easy work around for this?

Upvotes: 2

Views: 1210

Answers (1)

crazymatt
crazymatt

Reputation: 3286

Assuming that you already have your side nav setup and working with twitter bootstrap you would use the data-offset-bottom to stop it from scrolling in your footer. Heres an example:

<div id="leftnav" data-spy="affix" data-offset-top="149" data-offset-bottom="385">

You will have to play around with the numbers so that it works with the sizes of your footer so it will stop before it reaches the bottom. You can read about it here. Hope that helps.

Upvotes: 1

Related Questions