2013-01-09 43 views
2

我正在創建需要在iPad上查看的網頁。無法禁用iPad應用程序中的突出顯示顏色

一切都很好,但每次點擊某件東西時,都會出現這種惱人的黑色閃光。我已經嘗試了不少解決方案:

html { 
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none; 
    -webkit-touch-callout:none; 
} 


<script type="text/javascript"> 
    document.documentElement.style.webkitTouchCallout = "none"; 
</script> 

即使將其添加到元素本身:

.viewCont { 
    width: 1000px; 
    height: 690px; 
    position: absolute; 
    background-repeat: no-repeat; 
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none; 
    -webkit-touch-callout:none; 
} 

它的工作原理,當我在Safari中查看它在我的iPad,但是當我使之成爲獨立的儀表板應用程序,閃爍返回。

任何人都有提示或建議?

回答

3

您必須將此應用於所有元素,而不僅僅應用於HTML標記。像這樣嘗試

html * { 
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none; 
    -webkit-touch-callout:none; 
} 
+1

順便說一句。爲了擺脫惱人的黑色高光,你只需要使用「-webkit-tap-highlight-color:rgba(0,0,0,0);」 –

相關問題