LoginSignup
1
0

More than 5 years have passed since last update.

Check to has style on an element

Posted at
    chkDivStl = document.createElement('div').style,
    prefixes = [
        'webkit', 'moz', 'Moz', 'ms', 'o'
    ];


SOY.Util.isTouch = isTouch = 'ontouchstart' in window;
SOY.Event.MOUSE_CLICK = 'click';
SOY.Event.MOUSE_DOWN  = (isTouch) ? 'touchstart' : 'mousedown';
SOY.Event.MOUSE_MOVE  = (isTouch) ? 'touchmove'  : 'mousemove';
SOY.Event.MOUSE_UP    = (isTouch) ? 'touchend' : 'mouseup';

SOY.Util.CSSType = {};

//check for transition type.
for (i = 0, l = prefixes.length; i < l; i++) {
    if (prefixes[i] + 'Transition' in chkDivStl) {
        SOY.Util.CSSType.TRANSITION = '-' + prefixes[i] + '-transition';
        SOY.Util.CSSType.TRANSITION_DURATION = '-' + prefixes[i] + '-transition-duration';
        break;
    }
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0