Support
Framework7 also comes with features detection library.
It is available 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');
}
getSupport
When we use Framework7 with ES modules, we need to use getSupport
util instead:
import { getSupport } from 'framework7';
const support = getSupport();
if (!support.touch) {
console.log('No touch support');
}
Support Properties
touch | Touch events support (touchstart, touchmove, touchend) |
pointerEvents | Pointer events support |
intersectionObserver | Intersection Observer support |
passiveListener | Passive event listener support |