lukasz-galka / ngx-gallery

Angular image gallery plugin
https://lukasz-galka.github.io/ngx-gallery-demo/
MIT License
436 stars 171 forks source link

how add mousewheel event to make a zoom in and zoom out #274

Open souhail-chougrani opened 5 years ago

souhail-chougrani commented 5 years ago

there is a way to add mousewheel event for ZoomIN and ZoomOut

mcepo commented 4 years ago
@ViewChild("gallery") gallery: NgxGalleryComponent;

@HostListener("mousewheel", ["$event"]) onMousewheel(event) {
    if (event.wheelDelta > 0) {
      this.gallery.preview.zoomIn();
    } else {
      this.gallery.preview.zoomOut();
    }
  } 

For future explorers

souhail-chougrani commented 4 years ago

@mcepo it work. thanks