This looks great :) Alas it doesn't work on non-touch (e.g. desktop) browsers that happen to be narrow. I'm guessing you'll want to check for the availability of touch events in your code, e.g.
if ('ontouchstart' in document.documentElement === true) {
/* do stuff */
}
This looks great :) Alas it doesn't work on non-touch (e.g. desktop) browsers that happen to be narrow. I'm guessing you'll want to check for the availability of touch events in your code, e.g.