diff --git a/templates/footer.html b/templates/footer.html index dc372d87..9ef36b15 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -61,5 +61,17 @@ }); $('.show').collapse(); + + // Coming from search result page click + if(window.location.hash !== "") { + // Somehow collapse is not working sync and calling show directly after + // yields no effect and there is no callback when it is ready + setTimeout(() => { + // Folds out the answer manually + $(window.location.hash).collapse('show') + // Avoids the answer being hidden by the floating header + window.scrollTo(0, $(window.location.hash).position().top) + }, 500) + }