Files
namaste/html/js/modules (optional)/smooth-scroll.js
gramps 373ebc8c93 Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node.
Original corpo Bitbucket history not included — clean archive commit.
2026-04-05 09:49:30 -07:00

19 lines
927 B
JavaScript
Executable File

'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
// SMOOTH SCROLL
var SMOOTH_SCROLL_DURATION = 700;
$('.smooth-scroll').on('click', 'a', function (event) {
event.preventDefault();
var elAttr = $(this).attr('href');
var offset = $(this).attr('data-offset') ? $(this).attr('data-offset') : 0;
var setHash = $(this).closest('ul').attr('data-allow-hashes');
$('body,html').animate({
scrollTop: $(elAttr).offset().top - offset
}, SMOOTH_SCROLL_DURATION);
if ((typeof setHash === 'undefined' ? 'undefined' : _typeof(setHash)) !== (typeof undefined === 'undefined' ? 'undefined' : _typeof(undefined)) && setHash !== false) {
history.replaceState(null, null, elAttr);
}
});