Skip to content

Instantly share code, notes, and snippets.

@optikalefx
Created October 7, 2013 17:33
Show Gist options
  • Save optikalefx/6871767 to your computer and use it in GitHub Desktop.
Save optikalefx/6871767 to your computer and use it in GitHub Desktop.
// ==========
// = Animated Scroll =
// ==========
(function($) {
$.modal = bootbox;
$('#top-section').parallax("50%", 0.1);
$('#work').parallax("50%", 0.3);
$('#about').parallax("50%", 0.1);
$('#services').parallax("50%", 0.1);
$('#contact').parallax("50%", 0.1);
$('.navbar').scrollspy()
//hide menu after click on mobile
$('.nav-collapse .nav > li > a').click(function(){
$('.collapse.in').removeClass('in').css('height', '0');
});
$(".mainNav a").click(function(e) {
e.preventDefault();
if(this.hash) {
var toPos = $(this.hash).position().top;
$("body,html").animate({
scrollTop : toPos
});
}
});
$("#contactForm").on("submit",function(e) {
e.preventDefault();
var data = $(this).serializeObject();
$.post(this.action, data, function(res) {
$.modal.alert("Thanks, We'll get back to you shortly");
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment