Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zzossig/hugo-theme-zzo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorpastalian <pastalian46@gmail.com>2020-10-19 19:21:41 +0300
committerpastalian <pastalian46@gmail.com>2020-10-19 19:21:41 +0300
commitea5e803159bcf21b673e45a8642a9007e2812637 (patch)
tree9e9157e3754c4457cd730d6ce0a3e64e3c5a618b /assets
parent11e70816622739105330ed568c04eb9c2fb54464 (diff)
Improve DOM editing
Diffstat (limited to 'assets')
-rw-r--r--assets/js/helper/fadeinout.js8
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;