I just had this same problem.
From the FAQ
Why doesn't the cycle-initialized event fire?
It does, I promise. But if you bind your event listener after it has already fired then you won't hear it. Double check that you're not binding too late.
You must bind the event before you run the cycle() init method.
Assuming that your set up your code like:
var pressSlideshow = $('.pressSlideshow').cycle();
pressSlideshow.on({
'cycle-post-initialize': function(event) {
console.log('call');
var a = $('img.cycle-slide-active');
var d = a.data('url');
if (d !== undefined) {
pressLink.attr('href', a.data('url')).show();
} else {
pressLink.hide();
}
},
'cycle-after': function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) {
var a = $(incomingSlideEl);
var d = a.data('url');
if (d !== undefined) {
pressLink.attr('href', a.data('url')).show();
} else {
pressLink.hide();
}
}
});
Do this instead:
$(document).on('cycle-post-initialize', '.pressSlideshow', function(){
console.log('call');
var a = $('img.cycle-slide-active');
var d = a.data('url');
if (d !== undefined) {
pressLink.attr('href', a.data('url')).show();
} else {
pressLink.hide();
}
});
var pressSlideshow = $('.pressSlideshow').cycle();
pressSlideshow.on({
'cycle-after': function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) {
var a = $(incomingSlideEl);
var d = a.data('url');
if (d !== undefined) {
pressLink.attr('href', a.data('url')).show();
} else {
pressLink.hide();
}
}
});
Take note of the .pressSlideshow
selector as yours could differ.
Cheers