I have some simple JavaScript (embedded in an event) that I want to fire only for small devices. Phones, etc...
Currently I'm doing
if ($(window).width() < 606) {
do_things();
}
But this feels clunky. Is there a way to only execute this for devices smaller than a certain breakpoint (aside from just setting an earlier variable)? Ideally something that works with my CSS breakpoints.
I'm using Bootstrap, so there may be an easy option that utilizes that.