JS版
function smtel(telno){
if((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPod') == -1) || navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') > 0 && navigator.userAgent.indexOf('SC-01C') == -1 && navigator.userAgent.indexOf('A1_07') == -1 ){
document.write(''+telno+'');
}else{
document.write(''+telno+'');
}
}
CSS
.tel-link {
color: #06F;
font-size: 16px;
font-weight: bold;
}
html
お問い合わせ:
jQuery版
$(function(){
var ua = navigator.userAgent;
if(ua.indexOf('iPhone') > 0 && ua.indexOf('iPod') == -1 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0 && ua.indexOf('SC-01C') == -1 && ua.indexOf('A1_07') == -1 ){
$('.tel-link').each(function(){
var str = $(this).text();
$(this).html($('').attr('href', 'tel:' + str.replace(/-/g, '')).append(str + ''));
});
}
});
CSS
.tel-link {
color: #06F;
font-size: 16px;
font-weight: bold;
}
html
お問い合わせ:00-0000-0000