features

硬件环境关键特性检测,直接通过KISSY全局对象调用

KISSY.Features.isXXX();

这类功能通常在判断硬件环境时使用,比如在KISSY的modules定义的代码:

KISSY.config('modules',{
        "dom/basic": {
                "alias": [
                        'dom/base',
                        KISSY.Features.isIELessThan(9) ? 'dom/ie' : '',
                        KISSY.Features.isClassListSupported() ? '' : 'dom/class-list'
                ]
        },
        "dom": {
                "alias": [
                        'dom/basic',
                        !KISSY.Features.isQuerySelectorSupported() ? 'dom/selector' : ''
                ]
        }
});

Methods Detail

seed.isDeviceMotionSupported()
void isDeviceMotionSupported ()
判断当前宿主环境是否支持手势事件
seed.isMsPointerSupported()
void isMsPointerSupported ()
判断当前宿主环境是否支持ie8的Pointer事件
seed.isTouchEventSupported()
void isTouchEventSupported ()
判断当前宿主环境是否支持触屏事件
seed.isHashChangeSupported()
void isHashChangeSupported ()
判断当前环境是否支持hashChange事件
seed.isTransitionSupported()
void isTransitionSupported ()
判断当前环境是否支持Transition动画
seed.isTransformSupported()
void isTransformSupported ()
判断当前环境是否支持Transform动画
seed.isClassListSupported()
void isClassListSupported ()
判断当前环境是否支持ClassList
seed.isQuerySelectorSupported()
void isQuerySelectorSupported ()
判断当前环境是否支持QuerySelector方法
seed.getTransitionPrefix()
void getTransitionPrefix ()
得到Transition属性的前缀
seed.getTransformPrefix()
void getTransformPrefix ()
得到Transform属性的前缀