mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-28 11:40:33 +00:00
changed defaults + scroll with offset
This commit is contained in:
parent
f3e1970e59
commit
52e897dcb9
10 changed files with 33 additions and 32 deletions
static/js
|
@ -164,7 +164,13 @@ jQuery(document).ready(function() {
|
|||
$('[data-search-input]').val(searchValue);
|
||||
$('[data-search-input]').trigger('input');
|
||||
var searchedElem = $('#body-inner').find(':contains(' + searchValue + ')').get(0);
|
||||
searchedElem && searchedElem.scrollIntoView();
|
||||
if (searchedElem) {
|
||||
searchedElem.scrollIntoView(true);
|
||||
var scrolledY = window.scrollY;
|
||||
if(scrolledY){
|
||||
window.scroll(0, scrolledY - 125);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clipboard
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue