Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

53
Vistas
Preventing a WordPress plugin from triggering a JavaScript animation

I'm using a WooCommerce plugin called Product Bundles, within this plugin is a JavaScript file which triggers a slideDown animation for an .on("change") event.

The code looks something like this:

.on( 'change', '.bundled_product_optional_checkbox input', function( event ) { 
  bundled_item.$bundled_item_content.slideDown( 200 );
})

What I'd like to do is entirely remove the animation from any of/all of these elements, since I want to always display the HTML elements. However displaying the elements regardless of the checkbox status still fires the animation and it looks very odd.

Since it's a plugin I cannot simply remove the slideDown animation from the plugin file but have to create my own file with an override.

I have tried using .stop() on the .bundled_item_cart_content element but it doesn't work. Are there any other ways to unhook animations, override or stop them before they start? (I also tried moving the order of my override file to ensure it fires both before and after Product Bundles JS file - at a loss I tried both!)

If it helps I have a test website that demonstrates this: Here. If you click 'Add' on the products you'll see the animation happen on the number input field. (My intention is to always have the number input shown but that's doable with CSS)

Any help would be much appreciated.

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos