JavaScript Web Page Mini-Map Plugin pagemap

Add-ons
2026-07-25 23:05 8 次浏览 • 0 次下载 5.5KB
JavaScript Web Page Mini-Map Plugin pagemap

pagemap

pagemap.js is a canvas-based mini navigation panel plugin for web pages. It creates a mini navigation panel similar to the one on the right side of the Sublime Text editor.

Usage

Include it in your HTML file.

1
<script type="text/javascript" src="path/to/pagemap.min.js"></script>

HTML Structure

Add a <canvas> element to the page.

1
<canvas id='map'></canvas>

CSS Styles

Use CSS to position the <canvas> element in the upper-right corner of the page.

1
2
3
4
5
6
7
8
#map {
position: fixed;
top: 0;
right: 0;
width: 200px;
height: 100%;
z-index: 100;
}

Initialize the Plugin

1
2
3
4
5
6
7
8
9
10
11
12
pagemap(document.querySelector('#map'), {
viewport: null,
styles: {
'header,footer,section,article': rgba(0,0,0,0.08),
'h1,a': rgba(0,0,0,0.10),
'h2,h3,h4': rgba(0,0,0,0.08)
},
back: rgba(0,0,0,0.02),
view: rgba(0,0,0,0.05),
drag: rgba(0,0,0,0.10),
interval: null
});
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare