# Using width/height detection to exclude tablets & phones

**URL:** <https://forum.kirupa.com/t/using-width-height-detection-to-exclude-tablets-phones/329542>\
**Category:** web dev\
**Created:** [September 11, 2012, 10:03pm UTC](https://forum.kirupa.com/t/using-width-height-detection-to-exclude-tablets-phones/329542 "2012-09-11T22:03:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)\
**Post date:** [September 11, 2012, 10:03pm UTC](https://forum.kirupa.com/t/using-width-height-detection-to-exclude-tablets-phones/329542/1 "2012-09-11T22:03:29Z")

</div>

I have a bottom of the browser hugging thing, that does not scroll, that is bad user experience for mobile and tablet devices. I would like to exclude them by detecting width/height and have found references to using this

```auto

function detectmob() { if(window.innerWidth <= 800 && window.innerHeight <= 600) { return true; } else { return false; }

```

Being a trial and error type reviser of existing js, I am unsure how to use that function in the following, to say “do nothing” or “abort”. Any and all suggestions or directions, much appreciated.

The plugin

[http://meerkat.jarodtaylor.com/wp-content/themes/meerkat-default/js/jquery.meerkat.1.3.js](http://meerkat.jarodtaylor.com/wp-content/themes/meerkat-default/js/jquery.meerkat.1.3.js)

```auto

$(function(){
$('.meerkat').meerkat({                      
  background:'url(\'http://someimage.jpg\') repeat-x left top',
      height: '90px',
      width: '940px',
      position: 'bottom',
      close: '.close-meerkat',
      dontShowAgain: '.dont-show',
      animationIn: 'fade',
      animationSpeed: 1000,
      removeCookie: '.reset'
}).addClass('pos-bot');
$('#bottom').click(function(){
      $('.meerkat').destroyMeerkat();
      $('.meerkat').meerkat({
        height: '90px',
        width: '940px',
        position: 'bottom',
        close: '.close-meerkat',
        dontShowAgain: '.dont-show',
        animationIn: 'slide',        
    animationSpeed: 1000,
        removeCookie: '.reset'
      }).removeClass('pos-bot');
     $('.code').hide();
     $('.bottom_').show();
     return false;
   });
 });

```
