473,473 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unable to apply Bootstrap ScrollSpy in a page

245 New Member
Hi,
I am trying to implement Bootstrap Scrollspy in my content page but unable to do that. I also used Affix in that code which is working perfectly fine. I used the ethics advised by bootstrap but still failed. I am unable to point out where i am lack in.

All i want as when we go to some specific section then the relevant navigation menu must be active. Live example is when we visit bootstrap and go to this link



http://twitter.github.com/bootstrap/...html#dropdowns

It moves directly to dropdown section at javascript.html page and active the dropdown navigation menu link.

My everything is working perfectly fine but it is not highlighting the active link. FOr that bootstrap is using Scrollspy.

Can some one guide me where i am doing wrong which causes problem.



Here is my JavaScript code
Expand|Select|Wrap|Line Numbers
  1. !function ($) {
  2.             $(function(){
  3.                 var $window = $(window);
  4.                 // Disable certain links in docs
  5.                 $('section [href^=#]').click(function (e) {
  6.                     e.preventDefault()
  7.                 });
  8.                 // side bar
  9.                 $('.bs-docs-sidenav').affix({
  10.                     offset: {
  11.                         top: function () { return $window.width() <= 940 ? 260 : 210 }, bottom: 300
  12.                     }
  13.                 });
  14.             });
  15.         }(window.jQuery);
  16.  
Here is my html code

Expand|Select|Wrap|Line Numbers
  1. <body data-spy="scroll" data-target=".bs-docs-sidebar">
  2.         <div class="container content">
  3.             <div class="row">
  4.                 <div class="span12">
  5.                     <h1>Pring, Pakistan’s Fastest Growing Social Network</h1>
  6.                     <p>Propel your business by connecting with consumers one-on-one.</p>
  7.                 </div>
  8.                 <div class="clearfix"></div>
  9.                 <div class="content-area">
  10.                     <div class="span4 bs-docs-sidebar">
  11.                         <ul class="nav nav-list bs-docs-sidenav">
  12.                             <li><a href="what-is-pring.php#a0">What is Pring?</a></li>
  13.                             <li><a href="what-is-pring.php#a1">Who uses Pring?</a></li>
  14.                             <li><a href="what-is-pring.php#a2">Get Started</a></li>
  15.                             <li><a href="what-is-pring.php#a3">Pring Services</a></li>
  16.                         </ul>
  17.                     </div>
  18.                     <div class="span8 content-inner">
  19.                         <div id="a0">
  20.                             <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
  21.                         </div>
  22.                         <div id="a1">
  23.                             <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
  24.                         </div>
  25.                         <div id="a2">
  26.                             <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
  27.                         </div>
  28.                         <div id="a3">
  29.                             <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
  30.                         </div>
  31.                     </div>
  32.                 </div>
  33.             </div>
  34.         </div>
  35.     </body>

Your prompt response would be really appreciated.

regards,
Nov 29 '12 #1

✓ answered by neovantage

I have fixed this issue. This was happening just because i am not using the parent div position relative.

1 4737
neovantage
245 New Member
I have fixed this issue. This was happening just because i am not using the parent div position relative.
Feb 11 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Helen Abell | last post by:
I have an ASP.Net application which works fine on the XP machine where it was developed, and also on one of the deployed machines, which is running Win2K Server and the .Net framework. However,...
2
by: Al Cadalzo | last post by:
I am doing a screen-scraping app using HttpWebRequest. I create the HttpWebRequest and then I call the GetResponse() method on it. I get the page back OK. The page has a 'Next' button on it. ...
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
1
by: Naby | last post by:
hello I'm trying to load a web page from web matrix web server using the following syntax http://IPaddress:portnumber/webpagename. When I try that syntax in the navigator I get error code...
3
by: Seok Bee | last post by:
Dear Experts, I am trying to set my workstation as a webserver. I managed to run my web application running from my own workstation by typing http://localhost/ in the browser and everything...
0
by: Seok Bee | last post by:
Hi, I am currently facing some difficulties in accessing my web page. I am creating my company intranet website. Currently, I am developing my webpages in my local machine with IIS activated....
1
by: believeinblue44 | last post by:
I have recently spent countless hours building, tweaking, and perfecting numerous forms and they all are working fine now and i'm nearly done...now all i have to do is put them as Web Data Pages, put...
1
by: gayak | last post by:
Hi all, When I try to print a page. I am unable to do so. I get a javascript error as "Access is Denied". When I googled I found out that the script in one window or frame is trying to access...
0
by: somsub | last post by:
Hi All, I am facing a problem while running a perl script through selenium RC server . I recorded oone log in test case with slenium IDE and run it after that with the ide only and it worked...
2
by: jesposito | last post by:
I have seen numerous posts with this problem, however none of the solutions have worked for me. I am using asp.net 4.0 forms authentication. I have the following set in my config file. ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.