helpcenter/helpcenter.r7-office.ru/Web/js/help/scrollanchor.js
2019-06-04 14:55:05 +03:00

21 lines
668 B
JavaScript

$(document).ready(function () {
function fixedHeaderOffset(hash) {
$('html, body').animate({
scrollTop: $(hash).offset().top - 71
}, 'fast');
}
var hash = location.hash;
if(hash !== '' && hash !== 'undefined') {
fixedHeaderOffset(hash);
}
$('.description a, .description td, .description div').on('click', function(){
var hashID = '#' + $(this).attr('id');
if(hashID !== '#' && hashID !== '#undefined') {
fixedHeaderOffset(hashID);
}
});
$(".spoiler_heading").on("click", function () {
$(this).next(".spoiler_code").slideToggle("fast");
});
});