Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destroy / reinit / events / hem zone #97

Open
cf-git opened this issue Jul 17, 2018 · 0 comments
Open

destroy / reinit / events / hem zone #97

cf-git opened this issue Jul 17, 2018 · 0 comments

Comments

@cf-git
Copy link

cf-git commented Jul 17, 2018

Hello. Thank you. You done great work.

  1. 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.

  1. 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
  1. I think there need custom events
  • There, possible, need for events chaining and simplify implementation in/with other code or libraries.
  1. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant