Created
December 15, 2014 13:00
-
-
Save TattyFromMelbourne/d033b99b58ce522eb285 to your computer and use it in GitHub Desktop.
tel markup example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>tel markup example</title> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <!-- Does not really matter what version of jQuery you use --> | |
<script> | |
var probablyPhone = ((/iphone|android|ie|blackberry|fennec/).test(navigator.userAgent.toLowerCase()) && 'ontouchstart' in document.documentElement); | |
function initialize() { | |
if ( !probablyPhone ) { | |
alert ("Your device is probably not a phone"); | |
( function( $ ) { | |
$( '.call' ).css ( "text-decoration", "none" ); | |
$( '.call' ).css ( "color", "black" ); | |
$( '.call' ).css ( "cursor", "default" ); | |
} )( jQuery ); | |
} | |
} | |
</script> | |
</head> | |
<body onLoad="initialize();"> | |
Please ring (a fictitious number in Australia): <a href="tel://+61391112222" class="call" onClick="return probablyPhone;">+61 3 9111 2222</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment