malsup / cycle2

2nd gen cycling
898 stars 237 forks source link

.cycle('destroy'); doesn't destroy sentinel when utilising data-cycle-auto-height="calc" #822

Open clkdigital opened 7 years ago

clkdigital commented 7 years ago

The title explains it all really, when using data-cycle-auto-height="calc" the destroy function doesn't remove the sentinel .

Zeg31 commented 6 years ago

same here

farinspace commented 6 years ago

The following should help ...

// removing style attr immediately after destroy doesn't seem to work, using a delay helps
$(document).on('cycle-destroyed', '.cycle-slideshow', function(){
    var slideshow = $(this);
    setTimeout(function(){
        slideshow.removeAttr('style');
    }, 100);
});