Skip to content

Instantly share code, notes, and snippets.

@zearadoua
Created October 18, 2017 09:59
Show Gist options
  • Save zearadoua/f387e7a631b5778b7725f91dccfa4b65 to your computer and use it in GitHub Desktop.
Save zearadoua/f387e7a631b5778b7725f91dccfa4b65 to your computer and use it in GitHub Desktop.
prevent call option in non mobile device
// desactivate call option in non mobile device
$(document).on('click', '[href^="tel:"]', function(e){
if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
e.preventDefault();
e.stopPropagation();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment