Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

cancel an event in javascript

// call the preventDefault() method on the event
function preventScrollWheel(event) {
  if (typeof event.cancelable !== 'boolean' || event.cancelable) {
    event.preventDefault();
  } else {
    // to call preventDefault() on it.
    console.warn(`The following event couldn't be canceled:`);
    console.dir(event);
  }
}

document.addEventListener('wheel', preventScrollWheel);
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue js readdir 
Javascript :: how to copy all the elements of an array except the last one in javascript 
Javascript :: jquery append after number of chars in string 
Javascript :: how to encode uri in prereuqest script postman 
Javascript :: to the power of javascript 
Javascript :: js validation library 
Javascript :: Scaling an image to fit on canvas 
Javascript :: javascript string.includes 
Javascript :: javascript location.href 
Javascript :: Connect MSSQL With JavaScript 
Javascript :: Convert array to string while preserving brackets 
Javascript :: loop array of objects 
Javascript :: writefile in node js 
Javascript :: react laravel 
Javascript :: mongoose remove data 
Javascript :: cookies in react native 
Javascript :: js reverse a strings in array 
Javascript :: how to add a variable in js 
Javascript :: install express generator 
Javascript :: js decrease opacity canvas 
Javascript :: how to copy an arry react 
Javascript :: return new array on sort js 
Javascript :: for in javascript 
Javascript :: how to refresh datatable in jquery 
Javascript :: How to Check if a Substring is in a String in JavaScript Using the includes() Method 
Javascript :: Using axios send a GET request to the address: 
Javascript :: disable zoom in app 
Javascript :: why did you render 
Javascript :: how the concat function works javascript 
Javascript :: tinymce return text and html 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =