簡體   English   中英

如何停止台式機/平板電腦上的“ tel:number”鏈接

[英]How to stop “tel:number” links from working on desktop / tablets

這一定很常見。...很抱歉,但是在這里找不到可行的解決方案...

我正在一個網站上(改造),它具有響應式CSS,例如:

/* Refecence from responsive.css
/* crank up to 5000px to support high res monitors and TV's */
@media only screen and (min-width: 1200px) and (max-width: 5000px) 
/* Portrait tablet to landscape and desktop - BROWSER SIZE 2 */
@media only screen and (min-width: 991px) and (max-width: 1200px) 
/* Landscape phone to portrait tablet - BROWSER SIZE 3 */
@media only screen and (min-width: 767px) and (max-width: 991px) 
/* All Mobile Sizes (devices and browser) - BROWSER SIZE 4 */
@media only screen and (max-width: 767px) 
/* Landscape phones and down - BROWSER SIZE 5 */
@media (max-width: 480px) 
/* iphone portrait mode - BROWSER SIZE 6 */
@media (max-width: 320px) 

我對此並不陌生,並且做了很多研究,但是我有兩個問題:

我計划有兩個HTML塊,一個隱藏,然后根據用戶是否在移動設備上使用JS或CSS隱藏適當的塊。

我希望避免使用useragent ,因為方法太多了。 默認情況下,Android不再解析沒有“ tel:”的數字(根據其他帖子)。 我在Nexus 5上進行了測試。另一方面,Firefox要求設備在“電話:”鏈接上使用。

  1. 我可以使用當前的@media CSS塊嗎? 如果是這樣的話,視網膜怎么辦?
  2. 或者基於用戶代理的JS可以以某種方式正常嗎?
  3. 其他選擇,我的意思是大多數人會做什么???

感謝幫助。

經過更多研究,我決定使用Java語言庫isMobile。

https://github.com/kaimallea/isMobile

似乎有很多人使用它,所以我認為它會起作用。

我擔心的是,如果出現新設備,我必須不斷更新此庫...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM