Skip to content

Instantly share code, notes, and snippets.

@imbcmdth
Forked from pcamp96/content
Last active December 17, 2015 16:19
Show Gist options
  • Save imbcmdth/5637825 to your computer and use it in GitHub Desktop.
Save imbcmdth/5637825 to your computer and use it in GitHub Desktop.
var isMobile = {
tests:[
function() {
return navigator.userAgent.match(/Android/i);
},
function() {
return navigator.userAgent.match(/BlackBerry/i);
},
function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
function() {
return navigator.userAgent.match(/Opera Mini/i);
},
function() {
return navigator.userAgent.match(/IEMobile/i);
}
],
any: function() {
return this.tests.some(function(e){ return e(); });
}
};
if (isMobile.any()) {
document.getElementById(readMoreButton).style.visibility="hidden";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment