Page 1 of 1

Get name from visible carosoul

Posted: Sun Mar 27, 2016 9:00 pm
by Moe

I have two carosouls on my page each with labels. Top Carosoul on the page has a label called ID1 and the bottom one has a large called ID2. Is there a way for me to retrieve the text from each of these labels in the visible carosouls? There are several items in each carsoul whixh come from a rest service. I only want the currently visible ones.

Any input would be greatly appreciated.


Get name from visible carosoul

Posted: Mon Mar 28, 2016 3:25 am
by Yurii Orishchuk

Hi Moe,

You can use following JS code to get current carousel item text for the the specified carousel:

pre

//Where "mobilecarousel_420" is your carousel name.
var carousel = jQuery('[name="mobilecarousel_420"]');

var activeItem = carousel.find(".ui-carousel-item.ui-carousel-active");

var activeItemText = activeItem.text().trim();

console.log("activeItemText = " + activeItemText);

/pre

Note: this code could be used under all events with action "Run javascript".

Regards.


Get name from visible carosoul

Posted: Mon Mar 28, 2016 3:40 am
by Moe

Thanks so much, but how do I get a specific label text within the active item?


Get name from visible carosoul

Posted: Mon Mar 28, 2016 7:08 am
by Serhii Kulibaba

Hello,

You are able to set title of the carousel item on it's properties panel: https://devcenter.appery.io/documenta...