How to remove a JS animation?

FueraDeLinea

Member
May 13, 2022
30
6
8
Hey,

I'm trying to remove a drop animation made in js (Animation issue video) that generates a poor UX to make a comfortable and simply instant reply like any social media platforms (for example, Reddit).

INFO
______
1. Site: staging2.educaenvivo.com
2. Full JS code where the animation is: Full JS Code
2. The class I'm trying to delete the animation from is #wpdcom .wpd-secondary-form-wrapper, but not problem if all animations are removed.
3. I've extracted the JS code and tried to delete the animation classes
JavaScript:
const element = document.getElementById("slideToggle");

element.remove();const element = document.getElementById("enableDropAnimation");

element.remove();

But It didn't work and I have not idea about JS, only CSS and some HTML.

Could anyone guide me? Thank you in advance 😊
 
Last edited:

MusoniusRufus

Active member
Babiato Lover
Nov 5, 2019
165
122
43
Europe
More code is needed to found the issue.

I have to assume that in the code both slideToggle and enableDropAnimation are HTML elements with such ID?
You can completely wipe the whole element to replace afterwards with what you want, but it simpler to replace it straight away not remove and add.

Anyway I think you will find better advice on a dev forum like stackoverflow and if you give a proper https://jsfiddle.net with the whole code (or a link to the site with such issue)
 
  • Like
Reactions: FueraDeLinea

alexmisaila

Legend member
Trusted Uploader
May 9, 2020
1,140
922
133
⭐⭐⭐⭐⭐
Hey,

I'm trying to remove a drop animation made in js (Animation issue video) that generates a poor UX to make a comfortable and simply instant reply like any social media platforms (for example, Reddit).

INFO
______
1. The class I'm trying to delete the animation from is #wpdcom .wpd-secondary-form-wrapper, but not problem if all animations are removed.
2. I've extracted the JS code and tried to delete the animation classes
JavaScript:
const element = document.getElementById("slideToggle");

element.remove();const element = document.getElementById("enableDropAnimation");

element.remove();

But It didn't work and I have not idea about JS, only CSS and some HTML.

Could anyone guide me? Thank you in advance 😊
Hi,
To remove the drop animation, you can try using the remove() method to remove the element with the wpdcom .wpd-secondary-form-wrapper class from the DOM. This will remove the element from the page and stop the animation from running.

Here is some example code that demonstrates how to remove the element:
Code:
const element = document.querySelector('.wpdcom .wpd-secondary-form-wrapper');
if (element) {
  element.remove();
}

Alternatively, if you just want to stop the animation without removing the element from the page, you can set the display property of the element to none. This will hide the element and stop the animation.

Here is some example code that demonstrates how to hide the element:
Code:
const element = document.querySelector('.wpdcom .wpd-secondary-form-wrapper');
if (element) {
  element.style.display = 'none';
}
 
  • Like
Reactions: FueraDeLinea

FueraDeLinea

Member
May 13, 2022
30
6
8
Thank you @MusoniusRufus I've added the URL in case anyone would like to help and I'll also ask in that forums. I wanted to try in Babiato first because I love the good energy this community gives off :giggle:
 

FueraDeLinea

Member
May 13, 2022
30
6
8
@alexmisaila Hi alex and thank you for your effort. Unfortunately it didn't work but I assume that is because my fault or incompletely information I gave you. I'll continue to search and asking.

Thank you a lot :giggle:
 

FueraDeLinea

Member
May 13, 2022
30
6
8
Try this CSS:
Code:
#wpdcom .wpd-secondary-form-wrapper {
  transform: none;
  -webkit-transform: none;
}
Don't use css hero (or any other), modify directly.
1. Added on the style.css core files from the plugin
2. Added on the Settings > Custom CSS where the plugin allows to add custom CSS.
3. Added on the Custom CSS window from Elementor
4. Added with Google Inspector to test again
5. Added even with the !important attribute

code added.png

Nothing worked yet :confused:
 

alexmisaila

Legend member
Trusted Uploader
May 9, 2020
1,140
922
133
⭐⭐⭐⭐⭐
1. Added on the style.css core files from the plugin
2. Added on the Settings > Custom CSS where the plugin allows to add custom CSS.
3. Added on the Custom CSS window from Elementor
4. Added with Google Inspector to test again
5. Added even with the !important attribute

Nothing worked yet :confused:
I see... Then I have my last solution to remove the animation entirely, delete from you code this lines (back up that file first):
Code:
$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
  "transform-origin": "right 0",
  "-webkit-transform-origin": "right 0",
  "transform": "scale(0.9)",
  "-webkit-transform": "scale(0.9)"
});
This will remove the animation from the #wpdcom .wpd-secondary-form-wrapper element.

It's also a good idea to remove the other CSS rules that are being applied to the #wpdcom .wpd-secondary-form-wrapper element, as they are no longer necessary once the animation has been removed.

Note that you may need to remove similar lines of code that are setting the transform property for other elements as well, depending on how the animation is being implemented.
 
  • Like
Reactions: FueraDeLinea

FueraDeLinea

Member
May 13, 2022
30
6
8
C
I see... Then I have my last solution to remove the animation entirely, delete from you code this lines (back up that file first):
Code:
$("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
  "transform-origin": "right 0",
  "-webkit-transform-origin": "right 0",
  "transform": "scale(0.9)",
  "-webkit-transform": "scale(0.9)"
});
This will remove the animation from the #wpdcom .wpd-secondary-form-wrapper element.

It's also a good idea to remove the other CSS rules that are being applied to the #wpdcom .wpd-secondary-form-wrapper element, as they are no longer necessary once the animation has been removed.

Note that you may need to remove similar lines of code that are setting the transform property for other elements as well, depending on how the animation is being implemented.
Okey, I'm working on it and I'll return you the feedback :) Could it work if I replace all the css values from "transform: scale" and "-webkit-transform" to 0? To avoid breaking the plugin
 

alexmisaila

Legend member
Trusted Uploader
May 9, 2020
1,140
922
133
⭐⭐⭐⭐⭐
C

Okey, I'm working on it and I'll return yout he feedback. Could it work if I replace all the css values from "transform: scale" and "-webkit-transform" to 0? To avoid breaking the plugin
I don't know, try it.... Anyways, my previous answer is my last known solution... If it doesn't work, then you have to search more for another answer
 
  • Like
Reactions: FueraDeLinea

FueraDeLinea

Member
May 13, 2022
30
6
8
I don't know, try it.... Anyways, my previous answer is my last known solution... If it doesn't work, then you have to search more for another answer
I tried to change all values to 0 and even remove the general var animation from the start of the JS but nothing worked. I'll continue to search. Thank you again for all your efforts Alex, I'm very grateful :D
 
  • Like
Reactions: alexmisaila

hellearth

Active member
Aug 19, 2020
365
113
43
I'm also looking for a way to remove JS-loaded div and class tags. It is in the Comment system in the article, but only when dragging to the end of the post, the JS will load the data. All attempts so far have been unsuccessful :(
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu