1
Fork 0

Cleanup creative JS

This commit is contained in:
Jake Howard 2016-11-27 20:55:28 +00:00
parent 169635a432
commit 04d307d696
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 6 additions and 16 deletions

View file

@ -17,7 +17,6 @@
"bootstrap-sass": "=3.3.7", "bootstrap-sass": "=3.3.7",
"font-awesome": "=4.6.3", "font-awesome": "=4.6.3",
"jquery": "=2.2.3", "jquery": "=2.2.3",
"jquery.easing": "=1.3.2",
"underscore": "=1.8.3", "underscore": "=1.8.3",
"wow.js": "=1.2.0" "wow.js": "=1.2.0"
}, },

View file

@ -2,17 +2,18 @@
* Start Bootstrap - Creative Bootstrap Theme (http://startbootstrap.com) * Start Bootstrap - Creative Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0. * Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0. * For details, see http://www.apache.org/licenses/LICENSE-2.0.
* (Edited for theorangeone.net)
*/ */
// jQuery for page scrolling feature - requires jQuery Easing plugin const NAVBAR_HEIGHT = $('#main-nav').height();
$('a.page-scroll').bind('click', function(event) { $('a.page-scroll').bind('click', function(event) {
const anchor = $(this); const anchor = $(this);
$('html, body').stop().animate( $('html, body').stop().animate(
{ {
scrollTop: ($(anchor.attr('href')).offset().top - 50) scrollTop: ($(anchor.attr('href')).offset().top - NAVBAR_HEIGHT)
}, },
1250, 750
'easeInOutExpo'
); );
event.preventDefault(); event.preventDefault();
}); });
@ -20,18 +21,10 @@ $('a.page-scroll').bind('click', function(event) {
// Highlight the top nav as scrolling occurs // Highlight the top nav as scrolling occurs
$('body').scrollspy({ $('body').scrollspy({
target: '.navbar-fixed-top', target: '.navbar-fixed-top',
offset: 51 offset: NAVBAR_HEIGHT + 1
}); });
// Closes the Responsive Menu on Menu Item Click // Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() { $('.navbar-collapse ul li a').click(function() {
$('.navbar-toggle:visible').click(); $('.navbar-toggle:visible').click();
}); });
// Offset for Main Navigation
$('#main-nav').affix({
offset: {
top: 50
}
});

View file

@ -1,6 +1,4 @@
import 'jquery.easing';
import './creative'; import './creative';
import WOW from 'wow.js'; import WOW from 'wow.js';
new WOW().init(); new WOW().init();