Override browsers CTRL+(WHEEL)SCROLL with javascript

前端 未结 3 748
情话喂你
情话喂你 2021-01-04 17:58

In most browsers on linux, CTRL+(WHEEL)SCROLL allows the user to zoom in and out of the page by enlarging or shrinking the size of all elements. Now I want to ove

3条回答
  •  余生分开走
    2021-01-04 18:42

    To add on to sdleihssirhc's answer... Instead of keeping track of the ctrl key yourself you can call e.ctrlKey in the wheelCheck method (in place of isCtrl). This will return true if the ctrl key was down.

    I haven't confirmed this works on other platforms, but in Windows it works in Chrome, Explorer, and FireFox.

提交回复
热议问题