903 posts
  • Has sold $1,000+ on Envato Market
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+4 more

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: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $750,000+ on Envato Market
  • Has referred 500+ members
+3 more
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
1714 posts How's the surf doing?
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Achieved the monthly Community Superstar Award
  • Made it to the Authors' Hall of Fame
+6 more

Create a custom Modernizr script to detect touch devices,

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes