Can you not use currentSlideEl with cycle-pre-initialize or cycle-initialize event? I want to check the current slide on site load/cycle initialisation.
I'm wanting to run a few functions on the first slide/current slide when it initialises. You cannot seem to use the callback signature currentSlideEl with the cycle-pre-initialize or cycle-initialize event? It seems the only event that allows you to use currentSlideEl is cycle-update-view which is, according to the docs, ...triggered after initialization, after a slide transition, and after a slide has been added or removed. However this causes some conflicts with my code as I do not need it to run after a slide transition, and after a slide has been added or removed
Is it possible to use currentSlideEl with the cycle-pre-initialize or cycle-initialize event? This is what I have so far (a snippet!).
$this.on('cycle-update-view', function(event, optionHash, slideOptionsHash, currentSlideEl) {
var slideBgColor = $(currentSlideEl).data('bgcolor');
var slideTextColor = $(currentSlideEl).data('textcolor');
$('body').css('background-color','#' + slideBgColor);
$('.site-title, .right-navigation ul li a, .holding-slider .each-slide .caption').css('color','#' + slideTextColor);
$(currentSlideEl).find('.lazy').loadImage();
});
Can you not use
currentSlideEl
withcycle-pre-initialize
orcycle-initialize
event? I want to check the current slide on site load/cycle initialisation.I'm wanting to run a few functions on the first slide/current slide when it initialises. You cannot seem to use the callback signature
currentSlideEl
with thecycle-pre-initialize
orcycle-initialize
event? It seems the only event that allows you to usecurrentSlideEl
iscycle-update-view
which is, according to the docs, ...triggered after initialization, after a slide transition, and after a slide has been added or removed. However this causes some conflicts with my code as I do not need it to run after a slide transition, and after a slide has been added or removedIs it possible to use
currentSlideEl
with thecycle-pre-initialize
orcycle-initialize
event? This is what I have so far (a snippet!).