Skip to content

Instantly share code, notes, and snippets.

@Serega1288
Last active August 2, 2016 10:09
Show Gist options
  • Save Serega1288/610ce9a842788b19e1ed to your computer and use it in GitHub Desktop.
Save Serega1288/610ce9a842788b19e1ed to your computer and use it in GitHub Desktop.
anime click scroll #
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')
})
});
@Ronii
Copy link

Ronii commented Nov 13, 2015

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment