Skip to content

Instantly share code, notes, and snippets.

@JGallardo
Last active December 20, 2015 13:08
Show Gist options
  • Save JGallardo/6136023 to your computer and use it in GitHub Desktop.
Save JGallardo/6136023 to your computer and use it in GitHub Desktop.
Example call-to-button. The purpose of this element is to be a call to action to actually call in, On mobile, the ability to just push it and call will be available. Otherwise on desktop, it is just a big visual cue. Now to add the Javascript to disable as a link when not on a mobile device.
@JGallardo
Copy link
Author

What I would like to build is a button that will allow the user to call in. On desktop this element will look like a big call-to-action, then on mobile this will be both a call-to-action and an actual method to call.

The challenge that I need to address now is that the ability to call should be only present when on mobile. But when on desktop (dictated by screen width?) this link should be deactivated. At the moment if someone happens to click on this from desktop, it attempts to open a page as "tel:888-336-1301"

Which produces the following error:

The address wasn't understood
Firefox doesn't know how to open this address, because the protocol (tel) isn't associated with any program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment