894 posts
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Grew a moustache for the Envato Movember competition
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
  • Elite Author
  • Has been a member for 4-5 years
  • Sold between 250 000 and 1 000 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Referred between 500 and 999 users
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
}
1184 posts How's the surf doing?
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Referred between 200 and 499 users
  • Exclusive Author
  • Has been a member for 3-4 years
  • Envato Studio (Microlancer) Beta Tester
+1 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