fixed scrollTop error
This commit is contained in:
parent
e267e4e7f9
commit
17dd654f02
1197
docs/css/styles.css
1197
docs/css/styles.css
File diff suppressed because it is too large
Load Diff
|
@ -31,19 +31,21 @@
|
|||
|
||||
/* persist navigation scroll point */
|
||||
(function () {
|
||||
var patternsNav = document.getElementById('patterns-nav')
|
||||
if (patternsNav) {
|
||||
var scrollPoint = patternsNav.scrollTop
|
||||
window.onunload = function () {
|
||||
window.onunload = function () {
|
||||
var patternsNav = document.getElementById('patterns-nav')
|
||||
if (patternsNav) {
|
||||
var scrollPoint = patternsNav.scrollTop
|
||||
localStorage.setItem('scrollPoint', scrollPoint)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
if (window.location.href.indexOf('patterns/') !== -1) {
|
||||
scrollPoint = parseInt(localStorage.getItem('scrollPoint'))
|
||||
} else {
|
||||
scrollPoint = 0
|
||||
if (document.getElementById('patterns-nav')) {
|
||||
if (window.location.href.indexOf('patterns/') !== -1) {
|
||||
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
|
||||
} else {
|
||||
document.getElementById('patterns-nav').scrollTop = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
}());
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -31,19 +31,21 @@
|
|||
|
||||
/* persist navigation scroll point */
|
||||
(function () {
|
||||
var patternsNav = document.getElementById('patterns-nav')
|
||||
if (patternsNav) {
|
||||
var scrollPoint = patternsNav.scrollTop
|
||||
window.onunload = function () {
|
||||
window.onunload = function () {
|
||||
var patternsNav = document.getElementById('patterns-nav')
|
||||
if (patternsNav) {
|
||||
var scrollPoint = patternsNav.scrollTop
|
||||
localStorage.setItem('scrollPoint', scrollPoint)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
if (window.location.href.indexOf('patterns/') !== -1) {
|
||||
scrollPoint = parseInt(localStorage.getItem('scrollPoint'))
|
||||
} else {
|
||||
scrollPoint = 0
|
||||
if (document.getElementById('patterns-nav')) {
|
||||
if (window.location.href.indexOf('patterns/') !== -1) {
|
||||
document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint'))
|
||||
} else {
|
||||
document.getElementById('patterns-nav').scrollTop = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
}());
|
||||
|
|
Loading…
Reference in New Issue
Block a user