diff options
author | zzossig <52706977+zzossig@users.noreply.github.com> | 2020-10-20 22:51:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 22:51:09 +0300 |
commit | d1f7c34911c6ba041cd6f055cef5d77841269e5e (patch) | |
tree | e09b3806ab9b5d6fc09af3a73e72f0b6979ae0d8 /assets | |
parent | 2b9b4f9e87b551bc1bc205f6540e77c7f4604640 (diff) | |
parent | ea5e803159bcf21b673e45a8642a9007e2812637 (diff) |
Merge pull request #328 from pastalian/master
Fix toc toggle bug
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/helper/fadeinout.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/assets/js/helper/fadeinout.js b/assets/js/helper/fadeinout.js index f511c7e..231dc0e 100644 --- a/assets/js/helper/fadeinout.js +++ b/assets/js/helper/fadeinout.js @@ -11,7 +11,7 @@ var fadeOut = function(node, duration) { requestAnimationFrame(tick); } else { node.style.opacity = ''; - node.style.display = 'none'; + node.classList.add('hide'); } }); } @@ -19,10 +19,8 @@ var fadeOut = function(node, duration) { var fadeIn = function (node, duration) { if (getComputedStyle(node).display !== 'none') return; - if (node.style.display === 'none') { - node.style.display = ''; - } else { - node.style.display = 'block'; + if (node.classList.contains('hide')) { + node.classList.remove('hide'); } node.style.opacity = 0; |