Support
Framework7 also comes with features detection library.
It is avaialable as a support
property of Framework7 class (Framework7.support
) and same property on initialized app instance (app.support
):
// If we need it in place where we don't have access to app instance or before we init the app
if (!Framework7.support.touch) {
console.log('No touch support');
}
// After we init the app we can access it as app instance property
var app = new Framework7({ /*...*/ });
if (!app.support.touch) {
console.log('No touch support');
}
Support Properties
touch | Touch events support (touchstart, touchmove, touchend) |
transforms3d | CSS 3D Transforms support |
flexbox | CSS Flexbox model support |
observer | Mutation Observers support |
passiveListener | Passive event listener support |
gestures | Gestures event support (gesturestart, gesturechange, gestureend) |