1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/static/src/js/utils.js

23 lines
661 B
JavaScript
Raw Normal View History

2015-12-01 08:33:23 +00:00
/* global $ */
2015-12-01 08:38:09 +00:00
2015-12-01 08:33:23 +00:00
$(function() { // https://css-tricks.com/snippets/jquery/smooth-scrolling/
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '')
&& location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
2015-12-28 18:12:39 +00:00
$('a[href="soon"]').click(function (e) {
e.preventDefault();
alert("Content coming soon, stand by!");
});