Skip to main content

Town of Amherst, Inspection Services, Residential Rental Property Registration & Inspection Program

Citation
Town of Amherst, Inspection Services, Residential Rental Property Registration & Inspection Program
Jurisdiction
Amherst (municipal)
Source
Official source

Related Parts of This Source

Full Text

1,397 chars
function scrollAdjustmentTS() {
if (!fixedTopTS || fixedTopTS.length !== 1 || !topAttachTS || topAttachTS.length !== 1) return;
const topPosition = fixedTopTS.css('position');
if (topPosition === 'fixed' || topPosition === 'absolute') {
const anchorBounding = anchor[0].getBoundingClientRect();
const attachBounding = topAttachTS[0].getBoundingClientRect();
const scrollTop = $(window).scrollTop();

fixedTopTS.css('top', Math.max(anchorBounding.bottom - 1, attachBounding.bottom));
} else {
fixedTopTS.css('top', initialTopTS);
}
}

$(window).load(function () {
setTimeout(function () {
resizeAdjustmentTS();
}, 350);

$(window).scroll(function () {
scrollAdjustmentTS();
});

var adjustTimeoutTS;
$(window).resize(function () {
clearTimeout(adjustTimeoutTS);
adjustTimeoutTS = setTimeout(function () {
resizeAdjustmentTS();
}, 350);
});

$.when(window.Pages.angularToolbarComplete).done(function () {
resizeAdjustmentTS();
});
});

End Fixed Nav Adjustment

Fixed Nav Adjustment

function getValueTS(elem, attr) {
const val = elem.css(attr);
if (val === undefined) return undefined;
const num = parseInt(val, 10);
if (num === NaN) return undefined;
return num;
}

function clampTS(number, min, max) {
return Math.min(Math.max(number, min), max);
}

function isPageEditingTS() {
return (
$("#doneEditing").length > 0 || // In live edit
typeof DesignCenter !== "undefined" // In theme manager
);
}