Skip to content

Simple Docsify plugin to add additional scroll on page load to ensure correct section is in view

License

Notifications You must be signed in to change notification settings

rizdaprasetya/docsify-fix-pageload-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DocsifyPageloadScrollPlugin

Description

This plugin try to ensure "direct-link to section", will scroll to the correct section/element.

Internally it check ?id=<element-id> parameter exist on the URL, uses scrollIntoView() on the element id, with delayed execution (2 second default) when Docsify's hook.ready is called.

Usage

Just include this script tag like the other default Docsify plugins (search, emoji, etc). Put it after Docsify script tag.

<script src="https://cdn.jsdelivr.net/gh/rizdaprasetya/docsify-fix-pageload-scroll@master/index.js"></script>

Background

Custom plugin to overcome Docsify scrolling issue.

Docsify have auto scrolling issue on direct-link to section of a page with images: docsifyjs/docsify#351

There was proposed fix, but sadly does not get merged for quite sometime.

This plugin does not directly fix it, but it adds another scroll, after the page loaded.

About

Simple Docsify plugin to add additional scroll on page load to ensure correct section is in view

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published