Skip to content

Commit

Permalink
Merge pull request StartBootstrap#70 from rrikesh/gh-pages
Browse files Browse the repository at this point in the history
Don't let the user lose scroll control when a '.page-scroll a' is cli…
  • Loading branch information
davidtmiller authored Jun 27, 2016
2 parents 561dec5 + 5043b2b commit 3ba328e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/contact_me.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $(function() {
//clear all fields
$('#contactForm').trigger("reset");
},
})
});
},
filter: function() {
return $(this).is(":visible");
Expand Down
11 changes: 9 additions & 2 deletions js/freelancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
$(function() {
$('body').on('click', '.page-scroll a', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({

$('html, body')
.bind('scroll mousedown DOMMouseScroll mousewheel keyup', function(){
$('html, body').stop();
})
.stop()
.animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');

event.preventDefault();
});
});
Expand All @@ -29,7 +36,7 @@ $(function() {
// Highlight the top nav as scrolling occurs
$('body').scrollspy({
target: '.navbar-fixed-top'
})
});

// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a:not(.dropdown-toggle)').click(function() {
Expand Down

0 comments on commit 3ba328e

Please sign in to comment.