Okay
  Public Ticket #2731718
SliderDidLoad not working
Closed

Comments

  • Bill Mitchell started the conversation

    Ok, this is bizarre and frustrating.

    I have two sliders on my page.  One has the deeplink "episode1", the other has the deeplink "cc".  When I click on a layer in the episode1 slider, https://www.mylink.com#episode1, it works perfectly.  But then after the slider reloads with the wordpress post, I want to update the second slider to 'cc'.

    On put this on SliderDidLoad:

    function( event, slider ) {
    document.location.hash='cc';
    }

    In my mind, this SHOULD work, but it does nothing.  I even put an alert on SliderDidLoad to make sure it was firing, and it was, but for some reason, it is ignoring my 

    function( event, slider ) {
    document.location.hash='cc';
    }

    This SHOULD work.  It doesn't.

    Any ideas?


    P.S, If I put my function on SliderWillLoad, it works perfectly but ignores the #episode1 in my href link.

    I just cant seem to win on this.



  •  244
    Kreatura Support replied

    Hello Bill,

    Thank you for getting in touch with us!

    You should use an nother event, for example the slideChangeDidComplete function.

    If you want to set a concrete slide to start the slider when the page reloads then you can set it in the slider settings / slideshow tab. If  you would like to set it dynamically, then you should use the sliderWillLoad or simply DOMReady event as the page loads.

    Also, you don't need to use deeplinks. There are API commands that can be used for any slider and slide at any time. Consider using them as they may give you more freedom. In this case, be sure to put a class on the sliders (slider settings / appearance / slider classes, to make it easier to reference them. we recommend reading the doc where there are some examples: https://layerslider.kreaturamedia.com/documentation/#api-examples

    In the future, we can only help if you provide a more detailed description, and even show us your page where we can see exactly what you would like to achieve. Thank you, in advance

    Best Regards,
    Andrea | Kreatura Support Team