Last active
August 2, 2016 10:09
-
-
Save Serega1288/610ce9a842788b19e1ed to your computer and use it in GitHub Desktop.
anime click scroll #
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($) { | |
//Ajax contact | |
var form = $('.contact-form'); | |
form.submit(function () { | |
$this = $(this); | |
$.post($(this).attr('action'), function(data) { | |
$this.prev().text(data.message).fadeIn().delay(3000).fadeOut(); | |
},'json'); | |
return false; | |
}); | |
//smooth scroll | |
$('.navigation > li').click(function(event) { | |
event.preventDefault(); | |
var target = $(this).find('>a').prop('hash'); | |
$('html, body').animate({ | |
scrollTop: $(target).offset().top | |
}, 500); | |
}); | |
$('.pet').click(function(event) { | |
event.preventDefault(); | |
var target = $(this).find('>a').prop('hash'); | |
$('html, body').animate({ | |
scrollTop: $(target).offset().top | |
}, 500); | |
}); | |
$('.go-top-wrap').click(function(event) { | |
event.preventDefault(); | |
var target = $(this).find('>a').prop('hash'); | |
$('html, body').animate({ | |
scrollTop: $(target).offset().top | |
}, 500); | |
}); | |
//scrollspy | |
$('[data-spy="scroll"]').each(function () { | |
var $spy = $(this).scrollspy('refresh') | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No