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!!!
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!!!
Hello Stefan,
This can be done with the following code:
function( event, slider ) {
jQuery( '#text' ).text( 'newtext' );
}
Best Regards,
George | Kreatura Dev Team