From 4c55bec0f7deef692d7e28350b4a0f38bb744ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20Tuna?= Date: Fri, 30 Jul 2021 12:01:00 +0300 Subject: [PATCH] Fixed target.className.replace is not a function issue `resetAnimation` function is throw >TypeError: target.className.replace is not a function at WOW.resetAnimation [That](https://github.com/matthieua/WOW/issues/185#issuecomment-319997317) get-set helper funcitons fot the attributes is useful to the issue. --- dist/wow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/wow.js b/dist/wow.js index 1db78ea..8f9f929 100644 --- a/dist/wow.js +++ b/dist/wow.js @@ -308,7 +308,7 @@ WOW.prototype.show = function(box) { this.applyStyle(box); - box.className = box.className + " " + this.config.animateClass; + box.setAttribute("class", box.getAttribute("class") + " " + this.config.animateClass); if (this.config.callback != null) { this.config.callback(box); } @@ -359,7 +359,7 @@ var target; if (event.type.toLowerCase().indexOf('animationend') >= 0) { target = event.target || event.srcElement; - return target.className = target.className.replace(this.config.animateClass, '').trim(); + target.setAttribute("class", target.getAttribute("class").replace(this.config.animateClass).trim()); } };