Is Touch Device Javascript is a fast, micro size (148bytes) and self-initializing touch browser detector. It creates a global boolean variable (IS_TOUCH_DEVICE
) which detects if browser's touch APIs implemented whether or not the current device has a touchscreen.
$ bower install is-touch-device --save
- Distribution file is in the
dist/
directory. - Demo: online touch api detect test
if ( IS_TOUCH_DEVICE ){
console.log('Touch APIs have detected...');
}
$ npm start
... and then open a browser and go to http://localhost:8080
$ npm run build
- Minified and mangled:
gulp-uglify
- Rename:
gulp-rename
Copyright (c) 2017 Hesam Bayat http://pixudio.com