Okay
  Public Ticket #3844131
event callback access a certain layer element
Open

Comments

  • Stefan started the conversation

    Hi, I tried to dynamically change the text of a text layer element after the slider was loaded with the id "text" in my layerslider. I get the data object by the console:

    function( event, slider ) {

    var data = slider.data;
    console.log( data );
    // Wert auslesen und in der Konsole ausgeben

    }

    I receive the data, see the layer "text", but what is the right syntax to refer the "text" layer an the value in JS? I tried something like slider.data.layers["text"], but this is always empty. I'm sure, the solution is very simple. Thanks!!!


  •  146
    George replied

    Hello Stefan,

    This can be done with the following code:

    function( event, slider ) {

    jQuery( '#text' ).text( 'newtext' );

    }

    Best Regards,
    George | Kreatura Dev Team