Okay
  Public Ticket #3613783
API or JavaScript
Closed

Comments

  • Ivan Stachoulenok started the conversation

    Hi,

    On the “WS Form” page I have a (hidden) “Text Field” Text ID: 25678. Where the catalog number of the fabric chosen by the client comes.

    On the same page in Content Text Editor ID: 9805 there is [layerslider id=”02”]. In which images of the product with the selected fabric will be shown to the client.

    How can I select the required slides through the API or JavaScript.

    I tried doing this via:

    Wehook-Action-Run JavaScript <a href="javascript:void(0);" onclick="$('#slider').layerSlider(2);">Change to slide 2</a>

    So far nothing is working out.

    Thanks, Ivan

  •  112
    George replied

    Hello Ivan,

    Slider have unique IDs so you cannot target them. Instead of that, I recommend to add a custom classname to your slider under Project Settings → Appearance
    Then, you should modify your code by the following way:

    Wehook-Action-Run JavaScript <a href="javascript:void(0);" onclick="jQuery('.custom-slider-class').layerSlider(2);">Change to slide 2</a>


    Attached files:  add-custom-classname.png

    Best Regards,
    George | Kreatura Dev Team