alexfoxy/lax.js

Only use lax on desktop screens

MarkusHeinisch opened this issue · 1 comments

Is there a simple solution to enable the library only if media query is > 1024? I've added this code to my component..

`const isDesktop = useMediaQuery({ query: '(min-width: 1024px)' });

useEffect(() => {
	console.log(isDesktop);
}, [isDesktop]);`

so i can detect if it is desktop. So now i can remove all the classes/selectors from alle elements, but this is not the best solution, i think. It would be better i can use a code like lax.uninit() or lax.disable. So is it possible to implement this feature that i'am able to switch the lax function?

Thanks,
Markus

You can use lax.removeElements to disable elements if you are using desktop.