如何点击显示和点击通话? [英] How to Click to show & Click to call?
本文介绍了如何点击显示和点击通话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用它来单击以显示电话号码,但我想在显示电话号码后单击以致电.有小费吗?预先感谢!
I'm using this to click to show a phone number but I want to make a click to call after showing the phone number. Any tips? Thanks in advance!
<span id="number" data-last="123-456-7896"><span>
<a class="see">(718)... Click to show </a></span>
$('#number').click(function() {
$(this).find('span').text( $(this).data('last') );
推荐答案
您需要插入带有 a tel:
或点击callto:
方案.
You need to insert a link with a tel:
or a callto:
scheme upon click.
例如:
$('#number').click(function() {
var tel = $(this).data('last');
$(this).find('span').html( '<a href="tel:' + tel + '">' + tel + '</a>' );
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span id="number" data-last="+1234567896">
<span><a class="see">(718)... Click to show </a></span>
</span>
这篇关于如何点击显示和点击通话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文