Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mouse wheel event angular for table

import { Directive, ElementRef, HostListener} from "@angular/core";
import { MyService } from "./my-service";
@Directive({
    selector: "[testDirec]"
})
export class Test {
  private initPointX: number;
  private initPointY: number;

  constructor(private ele: ElementRef,
        private serviceInstance: MyService) {
    }

    @HostListener('mousewheel', ['$event'])
    scroll(event: MouseEvent) {
        console.log("Entered mouse wheel");
        let wheelDelta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
        if(wheelDelta > 0) {
          factor = 0.5;
        }else {
         factor = 2.0;
        }

        this.initPointX = event.PageX;
        this.initPointY = event.PageY;   
    } 

}
Comment

PREVIOUS NEXT
Code Example
Javascript :: rerender a vue component 
Javascript :: react route path exact 
Javascript :: file_get_contents in javascript 
Javascript :: create empty json file python 
Javascript :: javascript if not 
Javascript :: uuid in node js 
Javascript :: update angular project 
Javascript :: blob to text javascript 
Javascript :: Function Alert,confirm,prompt 
Javascript :: react eslint prettier 
Javascript :: disable link react 
Javascript :: react spring 
Javascript :: javascript primitive data types 
Javascript :: use theme in component mui 
Javascript :: react history listen get previous location 
Javascript :: let var 
Javascript :: how to add lang attribute in next js 
Javascript :: button change slider value js 
Javascript :: bootstrap 4 modal popup remote url 
Javascript :: less than or equal to javascript 
Javascript :: post request with headers 
Javascript :: jquery on multiple events 
Javascript :: create secure jwt secret key using node crypto 
Javascript :: uncheck multiple checkboxes javascript 
Javascript :: express json body 
Javascript :: javascript window.onpopstate example 
Javascript :: hasownproperty javascript 
Javascript :: difference between undefined and null javascript 
Javascript :: disabled text color tailwind 
Javascript :: react-bootstrap problem-install new version 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =