twentytwenty
twentytwenty copied to clipboard
destroy / reinit / events / hem zone
Hello. Thank you. You done great work.
- I'm interesing how i can how i can destroy or reinit your lib.
- I'm try destroy container with trigger on container
container.on('destroy.twentytwenty',` function() {
var $this = $(this);
beforeImg.css('clip', "");
afterImg.css('clip', "");
$this.find('.twentytwenty-overlay').remove();
$this.find('.twentytwenty-handle').remove();
$this.find('img')
.removeClass('twentytwenty-before')
.removeClass('twentytwenty-after')
.each(function () {
this.style.removeProperty('clip');
});
$this.unwrap('.twentytwenty-wrapper');
$this.off('touchmove.twentytwenty')
.off('mousedown.twentytwenty')
.off('mouseleave.twentytwenty')
.off('mousemove.twentytwenty')
.off("movestart.twentytwenty")
.off("move.twentytwenty")
.off("moveend.twentytwenty");
});
$this.trigger('destroy');
For this i will add namespace for events which use container. Then i have problems with clip. I can't remove clip from images.
- How can i add some reinit method (or function or event)
- Sometimes i need refresh content on page dinamicaly and possible no need destroy container to renew content
- I think there need custom events
- There, possible, need for events chaining and simplify implementation in/with other code or libraries.
- I think possible need implement hem zones but this if from custom events section
- I mean after and before mouseover zones, to call some events or setted callback function
Thank you!