Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9219281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:04:51+00:00 2026-06-18T03:04:51+00:00

Ok so hoping this is final question on Bootstrap Scrollspy, almost there, one more

  • 0

Ok so hoping this is final question on Bootstrap Scrollspy, almost there, one more problem to fix i hope. As I have read having a body of 100% seems to disagree with scrollspy ( Im using sticky footer). The final element in my nav is highlighted no matter where i am on the page.

I have tried removing 100% body
I have tried removing the scrollspy js
I have tried setting the body as the target element
I have tried $('body').scrollspy();

None of these work. If i set the height though on the element I am spying on then it does work, though it seems to scroll past the target element quite a bit and then change. I would like to still be able to keep sticky footer.

Here is my code

View

<div class="container">
 <div class="row show-grid clear-both">
  <div id="left-sidebar" class="span3 sidebar">
    <div class="side-nav sidebar-block">
     <div id="dateNav">
      <h3 class="resultTitle fontSize13">Release Dates</h2>
       <ul class="nav date">
        <% @response.each_pair do |date, movie| %>
        <li><i class="icon-chevron-right"></i><%= link_to date_format(date), "#d_#{date}", :id=> '#d_#{date}' %></li>
        <% end %>
      </ul>
     </div>
    </div>
  </div>
<div class="span9">
  <div id="spyOnThis" data-spy="scroll" data-target="#dateNav">
   <% @response.each_pair do |date, movie| %>
    <h3 class="resultTitle fontSize13" id="d_<%= date %>">Available on&nbsp;<%= date_format(date) %></h3>
    <% movie.each do |m| %>
      <div class="thumbnail clearfix">
        <!--Image here
    <% end %>>
        <div class="caption pull-right">
          <!--Content Here
        </div>
      </div>
    <% end %>
  <% end %>
  </div>
</div><!--span9-->
</div><!--Row-->
</div><!--/container-->

JS

$('#dateNav').scrollspy();

CSS

#dateNav{
position: fixed;
}

#spyOnThis {
height:100%;
overflow:auto;
}

.side-nav .active a {
 color: #FFBE00;
}

HTML Output (Nav)

  <div id="left-sidebar" class="span3 sidebar">
   <div class="side-nav sidebar-block">
    <div id="dateNav">
     <h3 class="resultTitle fontSize13">Release Dates</h3>
     <ul class="nav date">
    <li><i class="icon-chevron-right"></i>
    <a id="#d_#{date}" href="#d_2013-01-09">9th Jan 2013</a>
    </li>
    <li><i class="icon-chevron-right"></i>
    <a id="#d_#{date}" href="#d_2013-01-11">11th Jan 2013</a>
  </li>
  <li class="active"><i class="icon-chevron-right"></i>
  <a id="#d_#{date}" href="#d_2013-01-30">30th Jan 2013</a>
  </li>
  </ul>
  </div>
 </div>
 </div>

Element being spied on

<div class="span9">
 <div id="spyOnThis" data-target="#dateNav" data-spy="scroll">

  <h3 id="d_2013-01-09" class="resultTitle fontSize13">Available on 9th Jan 2013</h3>
   <div class="thumbnail clearfix">
    <!--Image Here -->
    <div class="caption pull-right">
     <!--Paragraphs in here -->
    </div>
   </div>

    <h3 id="d_2013-01-11" class="resultTitle fontSize13">Available on 11th Jan 2013</h3>
     <div class="thumbnail clearfix">
    <!--Image Here -->
     <div class="caption pull-right">
    <!-Paragraphs here
     </div>
    </div>

     <div class="thumbnail clearfix">
      <!-- Image Here-->
      <div class="caption pull-right">
       <!-paragraphs here -->
      </div>
    </div>

     <div class="thumbnail clearfix">
      <!-- Image Here-->
      <div class="caption pull-right">
       <!-paragraphs here -->
      </div>
    </div>

     <h3 id="d_2013-01-09" class="resultTitle fontSize13">Available on next date</h3>
   <div class="thumbnail clearfix">
    <!--Image Here -->
    <div class="caption pull-right">
     <!--Paragraphs in here -->
    </div>
   </div>
   </div>
   </div>

Apologies for the amount of code but better to have more on there i guess

So does anyone know of a solution for this as scrollspy does seem quite buggy at the moment

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:04:52+00:00Added an answer on June 18, 2026 at 3:04 am

    You simply can’t set 100% height on the element you’re spying on with ScrollSpy, whether it be body or another div.
    However, there is an issue on GitHub that suggests a workaround for this (also discussed here).

    In your case, this would be:

    $(window).scrollspy({wrap: $('#spyOnThis')[0]});
    

    Here’s a jsFiddle of your code that works with that fix. Note that I changed some of your HTML:

    • I removed the data-target and data-spy attributes again. When initiating ScrollSpy, use either the data attributes or the JavaScript.
    • I gave your span9 div the #spyOnThis ID, since the extra markup was unnecessary.

    Hopefully this will resolve it once and for all.

    EDIT

    This solution worked; for @Richlewis’ specific scenario we needed to add the parameter offset: -250 to ScrollSpy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm hoping this will be an easy one :) I've been stuffing around for
I'm hoping this question has a very simple answer. I can think of ways
I am hoping that this will have a pretty quick and simple answer. I
This problem is best described with an example. I have the following ClientBundle in
I have a semi-complicated problem and hoping that someone here will be able to
This is my second question, and I’m hoping to resolve an issue that I
EDIT: woah ... somehow i replaced this question with another one i was asking,
This question concerns general concepts surrounding the tcp/ip protocol, for which there are already
This might be an odd question, but I have form in MVC3 that posts
So this is not a very general question, but I was hoping some people

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.