Skip to content

Commit f7a9906

Browse files
committed
Fix navbar with affix and scrollby
1 parent 2c13e03 commit f7a9906

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

Diff for: samples.html

+19-13
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
bottom: -2px;
5858
}
5959
.nav-tabs>li.active a,
60-
.nav-tabs>li.active a:focus {
60+
.nav-tabs>li.active a:focus,
61+
.nav>li.active>a{
6162
background-color: #f5f5f5;
6263
height: 44px;
6364
}
@@ -70,8 +71,8 @@
7071
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
7172
<![endif]-->
7273
</head>
73-
<body>
74-
<div class="jumbotron sts-jumbotron text-center">
74+
<body data-spy="scroll" data-target=".scrollspy">
75+
<div class="jumbotron sts-jumbotron text-center" id="top">
7576
<div class="container">
7677
<h1 class="sts-title"><i class="fa fa-exchange"></i> jQuery StringToSlug</h1>
7778
<p class="sts-subtitle">Convert any string into slugs and bind using jQuery</p>
@@ -558,7 +559,7 @@ <h2 class="page-header">AND</h2>
558559
</div><!-- panel -->
559560
</section>
560561

561-
<section class="sts-section" id="js-options">
562+
<section class="sts-section" id="js-options-options">
562563
<h2 class="page-header">options</h2>
563564
<p>Use <strong>options</strong> to customize <strong><a href="http://pid.github.io/speakingurl/">SpeakinURL</a></strong>.</p>
564565
<div class="panel panel-default">
@@ -648,16 +649,20 @@ <h2 class="page-header">callback</h2>
648649
</section>
649650
</div>
650651
<div class="col-sm-3 scrollspy">
651-
<nav class="hidden-print hidden-xs hidden-sm affix-top" data-spy="affix">
652+
<nav class="hidden-print hidden-xs hidden-sm" data-spy="affix">
652653
<ul class="nav">
653654
<li><a href="#js-getting-started">Getting Started</a></li>
654655
<li><a href="#js-basic-usage">Basic Usage</a></li>
655-
<li><a href="#js-options">Options</a>
656-
<ul class="nav">
657-
<li><a href="#js-setevents">setEvents</a></li>
658-
<li><a href="#js-getput">getPut</a></li>
659-
</ul>
660-
</li>
656+
<li><a href="#js-options">Options</a></li>
657+
<li><a href="#js-setevents">Options: setEvents</a></li>
658+
<li><a href="#js-getput">Options: getPut</a></li>
659+
<li><a href="#js-space">Options: space</a></li>
660+
<li><a href="#js-prefix">Options: prefix</a></li>
661+
<li><a href="#js-suffix">Options: suffix</a></li>
662+
<li><a href="#js-replace">Options: replace</a></li>
663+
<li><a href="#js-and">Options: AND</a></li>
664+
<li><a href="#js-options-options">Options: options</a></li>
665+
<li><a href="#js-callback">Options: callback</a></li>
661666
</ul>
662667
<a class="back-to-top" href="#top">
663668
Back to top
@@ -735,9 +740,10 @@ <h2 class="page-header">callback</h2>
735740

736741
$('[data-spy="affix"]').affix({
737742
offset: {
738-
top: $('[data-spy="affix"]').offset().top
743+
top: $('[data-spy="affix"]').offset().top,
744+
bottom: 120
739745
}
740-
});
746+
} ).css('top','0');
741747
});
742748
</script>
743749
</body>

0 commit comments

Comments
 (0)