• Resolved catacaustic

    (@catacaustic)


    I’ve used this plugin on a client site, and they want to have the swatches inside a slider so they can scroll. Because of the way that the slider is set up, it clones the swatch elements, and adds them into it’s own systems. This removes the JavaScript events from the swatch areas, and I can’t click on anything to select it.

    Is there a way that the JavaScript events can be re-applied after the slider has been set up, or any other suggestions that might help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor getwooplugins

    (@getwooplugins)

    @catacaustic,

    If your theme follow wordpress ‘post-load’ event with document then you don’t have to do anything.
    Here is the details about it: https://codex.www.ads-software.com/AJAX_in_Plugins#The_post-load_JavaScript_Event

    But if you don’t then just call this javascript function on ajax load event

    $('.variations_form').each(function(){
    $(this).wc_variation_form();
    });

    And your are ready to go.

    • This reply was modified 5 years, 2 months ago by getwooplugins.
    Thread Starter catacaustic

    (@catacaustic)

    That is a good solution, but in my case it doesn’t work. I think that’s a lot more to do with the slider, so I’ll see if I can get some answers from that side of things, as what you’ve offered here is about the best that could be done.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I re-apply JavaSCript events?’ is closed to new replies.