2015-04-12 50 views
0

鏈接這一定是很常見的....我很抱歉,但不能在這裏找到一個有效的解決方案......如何阻止「電話:號」從桌面工作/粒

我的工作在網站上(改造),它具有響應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來隱藏approp根據用戶是否在移動設備上進行riate block。

我希望避免useragent,因爲有太多的方式。默認情況下,Android不再解析數字(如其他帖子),而不使用'tel:'。我在Nexus 5上進行了測試。另一方面,Firefox要求設備在「tel:」鏈接上使用。

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

幫助表示讚賞。

回答

0

經過更多的研究,我決定在Javascript庫isMobile。

https://github.com/kaimallea/isMobile

似乎很多使用它,所以我認爲這是可行的。

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