894 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
infuse01 says

I’m currently in the process of creating my next item and came across that a responsive layout through media queries is all good but what about the javascript. For example tooltips or even hover effects aren’t needed on mobile phones. How would I pass them properly?

I already know about responsejs, but how are you doing it? Any alternatives? Is responsivejs the way to go? Any feedback would be appreciated as usual :)

31 posts
  • Has referred 500+ members
  • Has sold $750,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
Brankic1979 says
I’m using this function
function is_touch_device() {
  return !!('ontouchstart' in window);
}
.
.
.
if (is_touch_device()){
do something only on mobile devices
} else {
do something only on not mobile devices
}
1245 posts How's the surf doing?
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+6 more
tommusrhodus says

Create a custom Modernizr script to detect touch devices,

call custom .js when touch devices are detected using that script :)

by
by
by
by
by
by