/js/tool.js
https://bitbucket.org/baniol/mobilang · JavaScript · 35 lines · 17 code · 5 blank · 13 comment · 2 complexity · 980e41007fef2d95e32545562e512226 MD5 · raw file
- var fijsTool = {
-
- /**
- * True if mobile
- */
- mobileDevice: false,
-
- /**
- * Click/touch event trigger (mobile/fix)
- */
- triggerEvent:null,
-
- /**
- * Global settings
- */
- initFijsTool: function(){
- // mobile detect
- if(this.detectMobile()){
- this.startEvent = 'touchstart';
- this.endEvent = 'touchend';
- }else{
- this.startEvent = 'mousedown';
- this.endEvent = 'mouseup';
- }
- },
-
- /**
- * Returns true if mobile browser
- */
- detectMobile: function(){
- var check = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/);
- return check !== null || this.phonegap ? true: false;
- }
-
- }