Moe
Posts: 0
Joined: Thu Jul 10, 2014 9:24 pm

Get name from visible carosoul

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Get name from visible carosoul

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.

Moe
Posts: 0
Joined: Thu Jul 10, 2014 9:24 pm

Get name from visible carosoul

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Get name from visible carosoul

Hello,

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

Return to “Issues”