繁体   English   中英

隐藏电话:桌面链接

[英]Hiding tel: link on desktops

在此站点上, 网站链接在右上角有一个移动电话的tel:链接的联系信息。 我们如何以最佳(最简单)的方式隐藏tel:链接在桌面上? 现在我有这个:

CSS:

#header .contact-info1 { width: 253px; height: 50px; display: block; float: right;     background: url(contact-info1.png) 0 0 no-repeat transparent; margin-right: 39px; margin-    top: 110px; }
#header .contact-info2 { width: 292px; height: 51px; display: block; float: right;     background: url(contact-info2.png) 0 0 no-repeat transparent; margin-right: 0px; margin-    top: 30px; }

@media only screen and (max-device-width: 480px) {
#header .contact-info1-mobile { width: 253px; height: 50px; display: block; float:     right; cursor: pointer; background: url(contact-info1.png) 0 0 no-repeat transparent;     margin-right: 39px; margin-top: 110px; }
#header .contact-info2-mobile { width: 292px; height: 51px; display: block; float:     right; cursor: pointer; background: url(contact-info2.png) 0 0 no-repeat transparent;     margin-right: 0px; margin-top: 30px; }

HTML:

<a href="tel:+491796737741" class="contact-info1-mobile" ></a>
<div style="clear:right"></div>
<a href="mailto:info@rw-fliesen.com" class="contact-info2-mobile" ></a>

目前,我要隐藏台式机的链接,但是如何隐藏台式机的链接,同时又显示台式机的联系图像?

您也可以使用jquery通过$(window).resize做到这一点

$(window).resize(function() {
    var width = $(window).width();
    if (width < 750) {
        // Do Something
    }
    else {
        //Do Something Else
    }
});

通过使用jQuery or javascript浏览器检测为我评论中的链接提及的另一种选择

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM