Add anchor points to post list page
* post-year now has anchor point, you can click on it or input url with hash tag to jump to a specific year. * See #39
This commit is contained in:
parent
e6177e0fde
commit
028dc62e3b
7 changed files with 16 additions and 5 deletions
|
@ -86,6 +86,12 @@ if (header !== null) {
|
|||
listen('#img-btn', "click", showImg);
|
||||
listen('.bg-img', "click", hideImg);
|
||||
|
||||
document.querySelectorAll('.post-year').forEach((ele)=> {
|
||||
ele.addEventListener('click', () => {
|
||||
window.location.hash = '#' + ele.id;
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('scroll', throttle(() => {
|
||||
autoHideHeader();
|
||||
|
||||
|
|
|
@ -408,6 +408,11 @@ p.img-404 {
|
|||
margin-right: 1.8em;
|
||||
font-size: 1.6em;
|
||||
@include dimmed;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.posts-list {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue