multiple carousel + each caption on hover
-
hey,
i was wondering if it is possible to have multiple carousels on one page while displaying their caption on hover?
(because of using the .lay-carousel-sink-parent class with jquery it fades in all at the same time)eventually there is a selector to target the captions of each carousel?
thanks in advance,
johannesedit: it is possible to achieve by adding a custom class to the carousel and then use this custom class to target the captions for each carousel
-
hey,
i was wondering if it is possible to have multiple carousels on one page while displaying their caption on hover?
(because of using the .lay-carousel-sink-parent class with jquery it fades in all at the same time)eventually there is a selector to target the captions of each carousel?
thanks in advance,
johannesedit: it is possible to achieve by adding a custom class to the carousel and then use this custom class to target the captions for each carousel
anyone with similar problem:
the solution is to give each carousel an id and then you can target the caption with the help of the id in jquery for example:jQuery(document).on("mouseenter", "#carousel-id", function(event) { jQuery("#carousel-id .lay-carousel-sink-parent").animate({ opacity: 1 }, 1000); }); jQuery(document).on("mouseleave", "#carousel-id", function(event) { jQuery("#carousel-id .lay-carousel-sink-parent").animate({ opacity: 0 }, 1000); }); -
ah very nice!
-
maybe this is better, without js:
#carousel-id .lay-carousel-sink-parent{ opacity: 0; transition: opacity 1000ms ease; } #carousel-id:hover .lay-carousel-sink-parent{ opacity: 1; } -
maybe this is better, without js:
#carousel-id .lay-carousel-sink-parent{ opacity: 0; transition: opacity 1000ms ease; } #carousel-id:hover .lay-carousel-sink-parent{ opacity: 1; }@arminunruh thank you! guess css even better and faster