0

I have jquery popup which opens on all browsers from mobiles and pc. i don't want to show it on mobile browsers so how can i do that ?

function lightbox(){
$.colorbox({inline:true, href:"#inline_content",onClosed: pauseSound, overlayClose: false});
            }

Thanks!

Amirhossein Mehrvarzi
  • 18,024
  • 7
  • 45
  • 70
  • possible duplicate of [What is the best way to detect a handheld device in jQuery?](http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-handheld-device-in-jquery) – mplungjan Aug 23 '13 at 12:29

2 Answers2

0

You can try this:

function lightbox(){
if (screen.width <=700) #or whatever you want
  {
  $.colorbox({inline:true, href:"#inline_content",onClosed: pauseSound, overlayClose: false});
  }
}
Manolo
  • 24,020
  • 20
  • 85
  • 130
0

Building on What is the best way to detect a mobile device in jQuery? you can do this

function lightbox(){
  if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
    return;
  }
  $.colorbox({inline:true, href:"#inline_content",onClosed: pauseSound, overlayClose: false});
 }
Community
  • 1
  • 1
mplungjan
  • 169,008
  • 28
  • 173
  • 236