I had high hopes that I had found a solution using detectmobilebrowser.js for preventing another jquery plugin from executing if mobile/tablet is detected. The method uses if(isMobile)
{window.location.href = to redirect. Works perfectly, until it is implemented as it needs to be, as an include, at which point it works too well, as it is redirecting even when it is not mobile/tablet.
I was thinking I need to do something other than redirect if isMobile is true, but I am at a loss.
The jquery meerkat plugin does this in order to display a bottom of the browser hugging div, that is really bad user interface on mobile/tablet, which is why I need to prevent it from showing.
$(function(){
$('.meerkat').meerkat({
background:'url(\'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;
});
});
This is the meerkat demo