Skip to content

Commit 8c9795b

Browse files
authored
smooth scrolling issue fixed #50 (#134)
* Keynote image added * Keynote info added * Changes done for viewport height * Changes done for viewport height * js added for smooth scrolling * change placing of header * add id for linking in smooth scrolling * rendered files
1 parent 3d2e6b1 commit 8c9795b

File tree

11 files changed

+281
-20
lines changed

11 files changed

+281
-20
lines changed

childcare.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -183,6 +184,34 @@ <h1 class="animated fadeInDown">Childcare</h1>
183184
<script src="js/vendor/jquery-library.js"></script>
184185
<script src="js/vendor/bootstrap.min.js"></script>
185186
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
187+
<script>
188+
$(document).ready(function(){
189+
// Add scrollspy to <body>
190+
$('body').scrollspy({target: ".navbar", offset: 50});
191+
192+
// Add smooth scrolling on all links inside the navbar
193+
$("#tg-navigation a").on('click', function(event) {
194+
// Make sure this.hash has a value before overriding default behavior
195+
if (this.hash !== "") {
196+
// Prevent default anchor click behavior
197+
event.preventDefault();
198+
199+
// Store hash
200+
var hash = this.hash;
201+
202+
// Using jQuery's animate() method to add smooth page scroll
203+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
204+
$('html, body').animate({
205+
scrollTop: $(hash).offset().top
206+
}, 800, function(){
207+
208+
// Add hash (#) to URL when done scrolling (default click behavior)
209+
window.location.hash = hash;
210+
});
211+
} // End if
212+
});
213+
});
214+
</script>
186215
<script src="js/customScrollbar.min.js"></script>
187216
<script src="js/packery.pkgd.min.js"></script>
188217
<script src="js/owl.carousel.min.js"></script>

coc.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -205,6 +206,34 @@ <h4>License</h4>
205206
<script src="js/vendor/jquery-library.js"></script>
206207
<script src="js/vendor/bootstrap.min.js"></script>
207208
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
209+
<script>
210+
$(document).ready(function(){
211+
// Add scrollspy to <body>
212+
$('body').scrollspy({target: ".navbar", offset: 50});
213+
214+
// Add smooth scrolling on all links inside the navbar
215+
$("#tg-navigation a").on('click', function(event) {
216+
// Make sure this.hash has a value before overriding default behavior
217+
if (this.hash !== "") {
218+
// Prevent default anchor click behavior
219+
event.preventDefault();
220+
221+
// Store hash
222+
var hash = this.hash;
223+
224+
// Using jQuery's animate() method to add smooth page scroll
225+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
226+
$('html, body').animate({
227+
scrollTop: $(hash).offset().top
228+
}, 800, function(){
229+
230+
// Add hash (#) to URL when done scrolling (default click behavior)
231+
window.location.hash = hash;
232+
});
233+
} // End if
234+
});
235+
});
236+
</script>
208237
<script src="js/customScrollbar.min.js"></script>
209238
<script src="js/packery.pkgd.min.js"></script>
210239
<script src="js/owl.carousel.min.js"></script>

faqs.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -300,6 +301,34 @@ <h4><span>Q.</span>My question is not listed here / I am still unclear about a f
300301
<script src="js/vendor/jquery-library.js"></script>
301302
<script src="js/vendor/bootstrap.min.js"></script>
302303
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
304+
<script>
305+
$(document).ready(function(){
306+
// Add scrollspy to <body>
307+
$('body').scrollspy({target: ".navbar", offset: 50});
308+
309+
// Add smooth scrolling on all links inside the navbar
310+
$("#tg-navigation a").on('click', function(event) {
311+
// Make sure this.hash has a value before overriding default behavior
312+
if (this.hash !== "") {
313+
// Prevent default anchor click behavior
314+
event.preventDefault();
315+
316+
// Store hash
317+
var hash = this.hash;
318+
319+
// Using jQuery's animate() method to add smooth page scroll
320+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
321+
$('html, body').animate({
322+
scrollTop: $(hash).offset().top
323+
}, 800, function(){
324+
325+
// Add hash (#) to URL when done scrolling (default click behavior)
326+
window.location.hash = hash;
327+
});
328+
} // End if
329+
});
330+
});
331+
</script>
303332
<script src="js/customScrollbar.min.js"></script>
304333
<script src="js/packery.pkgd.min.js"></script>
305334
<script src="js/owl.carousel.min.js"></script>

gallery.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -627,6 +628,34 @@ <h3>Our Events Gallery</h3>
627628
<script src="js/vendor/jquery-library.js"></script>
628629
<script src="js/vendor/bootstrap.min.js"></script>
629630
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
631+
<script>
632+
$(document).ready(function(){
633+
// Add scrollspy to <body>
634+
$('body').scrollspy({target: ".navbar", offset: 50});
635+
636+
// Add smooth scrolling on all links inside the navbar
637+
$("#tg-navigation a").on('click', function(event) {
638+
// Make sure this.hash has a value before overriding default behavior
639+
if (this.hash !== "") {
640+
// Prevent default anchor click behavior
641+
event.preventDefault();
642+
643+
// Store hash
644+
var hash = this.hash;
645+
646+
// Using jQuery's animate() method to add smooth page scroll
647+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
648+
$('html, body').animate({
649+
scrollTop: $(hash).offset().top
650+
}, 800, function(){
651+
652+
// Add hash (#) to URL when done scrolling (default click behavior)
653+
window.location.hash = hash;
654+
});
655+
} // End if
656+
});
657+
});
658+
</script>
630659
<script src="js/customScrollbar.min.js"></script>
631660
<script src="js/packery.pkgd.min.js"></script>
632661
<script src="js/owl.carousel.min.js"></script>

index.html

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -401,7 +402,7 @@ <h2>Real Choice For<span>The Real Business</span></h2>
401402
*************************************-->
402403

403404
<section class="tg-sectionspace tg-haslayout">
404-
<div class="container">
405+
<div class="container" id="schedule">
405406
<div class="row">
406407
<div class="col-xs-offset-0 col-xs-12 col-sm-offset-0 col-sm-12 col-md-offset-2 col-md-8 col-lg-offset-2 col-lg-8">
407408
<div class="tg-sectionhead">
@@ -885,6 +886,34 @@ <h3 class="wow fadeInDown text-center">Latest Blogs</h3>
885886
<script src="js/vendor/jquery-library.js"></script>
886887
<script src="js/vendor/bootstrap.min.js"></script>
887888
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
889+
<script>
890+
$(document).ready(function(){
891+
// Add scrollspy to <body>
892+
$('body').scrollspy({target: ".navbar", offset: 50});
893+
894+
// Add smooth scrolling on all links inside the navbar
895+
$("#tg-navigation a").on('click', function(event) {
896+
// Make sure this.hash has a value before overriding default behavior
897+
if (this.hash !== "") {
898+
// Prevent default anchor click behavior
899+
event.preventDefault();
900+
901+
// Store hash
902+
var hash = this.hash;
903+
904+
// Using jQuery's animate() method to add smooth page scroll
905+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
906+
$('html, body').animate({
907+
scrollTop: $(hash).offset().top
908+
}, 800, function(){
909+
910+
// Add hash (#) to URL when done scrolling (default click behavior)
911+
window.location.hash = hash;
912+
});
913+
} // End if
914+
});
915+
});
916+
</script>
888917
<script src="js/customScrollbar.min.js"></script>
889918
<script src="js/packery.pkgd.min.js"></script>
890919
<script src="js/owl.carousel.min.js"></script>

sponsors.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -265,6 +266,34 @@ <h3>Our Great Sponsers</h3>
265266
<script src="js/vendor/jquery-library.js"></script>
266267
<script src="js/vendor/bootstrap.min.js"></script>
267268
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
269+
<script>
270+
$(document).ready(function(){
271+
// Add scrollspy to <body>
272+
$('body').scrollspy({target: ".navbar", offset: 50});
273+
274+
// Add smooth scrolling on all links inside the navbar
275+
$("#tg-navigation a").on('click', function(event) {
276+
// Make sure this.hash has a value before overriding default behavior
277+
if (this.hash !== "") {
278+
// Prevent default anchor click behavior
279+
event.preventDefault();
280+
281+
// Store hash
282+
var hash = this.hash;
283+
284+
// Using jQuery's animate() method to add smooth page scroll
285+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
286+
$('html, body').animate({
287+
scrollTop: $(hash).offset().top
288+
}, 800, function(){
289+
290+
// Add hash (#) to URL when done scrolling (default click behavior)
291+
window.location.hash = hash;
292+
});
293+
} // End if
294+
});
295+
});
296+
</script>
268297
<script src="js/customScrollbar.min.js"></script>
269298
<script src="js/packery.pkgd.min.js"></script>
270299
<script src="js/owl.carousel.min.js"></script>

sponsorship.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
</div>
6565
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
6666
<ul>
67-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
68-
<li><a href="sponsorship.html">Sponsorship</a></li>
67+
<li><a href="index.html">Home</a></li>
6968
<li><a href="#speakers">Speakers</a></li>
69+
<li><a href="#schedule">Schedule</a></li>
70+
<li><a href="sponsorship.html">Sponsorship</a></li>
7071
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
7172
<li><a href="faqs.html">FAQs</a></li>
7273
<li class="menu-item-has-children">
@@ -181,6 +182,34 @@ <h3>Sponsoring</h3>
181182
<script src="js/vendor/jquery-library.js"></script>
182183
<script src="js/vendor/bootstrap.min.js"></script>
183184
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
185+
<script>
186+
$(document).ready(function(){
187+
// Add scrollspy to <body>
188+
$('body').scrollspy({target: ".navbar", offset: 50});
189+
190+
// Add smooth scrolling on all links inside the navbar
191+
$("#tg-navigation a").on('click', function(event) {
192+
// Make sure this.hash has a value before overriding default behavior
193+
if (this.hash !== "") {
194+
// Prevent default anchor click behavior
195+
event.preventDefault();
196+
197+
// Store hash
198+
var hash = this.hash;
199+
200+
// Using jQuery's animate() method to add smooth page scroll
201+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
202+
$('html, body').animate({
203+
scrollTop: $(hash).offset().top
204+
}, 800, function(){
205+
206+
// Add hash (#) to URL when done scrolling (default click behavior)
207+
window.location.hash = hash;
208+
});
209+
} // End if
210+
});
211+
});
212+
</script>
184213
<script src="js/customScrollbar.min.js"></script>
185214
<script src="js/packery.pkgd.min.js"></script>
186215
<script src="js/owl.carousel.min.js"></script>

templates/components/_base.jinja

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,34 @@
5858
<script src="js/vendor/jquery-library.js"></script>
5959
<script src="js/vendor/bootstrap.min.js"></script>
6060
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCR-KEWAVCn52mSdeVeTqZjtqbmVJyfSus&language=en"></script>
61+
<script>
62+
$(document).ready(function(){
63+
// Add scrollspy to <body>
64+
$('body').scrollspy({target: ".navbar", offset: 50});
65+
66+
// Add smooth scrolling on all links inside the navbar
67+
$("#tg-navigation a").on('click', function(event) {
68+
// Make sure this.hash has a value before overriding default behavior
69+
if (this.hash !== "") {
70+
// Prevent default anchor click behavior
71+
event.preventDefault();
72+
73+
// Store hash
74+
var hash = this.hash;
75+
76+
// Using jQuery's animate() method to add smooth page scroll
77+
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
78+
$('html, body').animate({
79+
scrollTop: $(hash).offset().top
80+
}, 800, function(){
81+
82+
// Add hash (#) to URL when done scrolling (default click behavior)
83+
window.location.hash = hash;
84+
});
85+
} // End if
86+
});
87+
});
88+
</script>
6189
<script src="js/customScrollbar.min.js"></script>
6290
<script src="js/packery.pkgd.min.js"></script>
6391
<script src="js/owl.carousel.min.js"></script>

templates/components/_header.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
</div>
1919
<div id="tg-navigation" class="collapse navbar-collapse tg-navigation">
2020
<ul>
21-
<li><a href="https://in.pycon.org/2016/">2016</a></li>
22-
<li><a href="sponsorship.html">Sponsorship</a></li>
21+
<li><a href="index.html">Home</a></li>
2322
<li><a href="#speakers">Speakers</a></li>
23+
<li><a href="#schedule">Schedule</a></li>
24+
<li><a href="sponsorship.html">Sponsorship</a></li>
2425
<li><a href="https://in.pycon.org/blog/">Blog</a></li>
2526
<li><a href="faqs.html">FAQs</a></li>
2627
<li class="menu-item-has-children">

templates/sections/_schedule.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section class="tg-sectionspace tg-haslayout">
2-
<div class="container">
2+
<div class="container" id="schedule">
33
<div class="row">
44
<div class="col-xs-offset-0 col-xs-12 col-sm-offset-0 col-sm-12 col-md-offset-2 col-md-8 col-lg-offset-2 col-lg-8">
55
<div class="tg-sectionhead">

0 commit comments

Comments
 (0)