2012-04-27 26 views
0

嗨,我有以下问题:Android ImageMap WebKit Highlightcolor

- 我使用ImageMap使图像的不同部分可点击,这很好。我通过WebViewClient拦截链接点击,并与他们做其他事情。问题是,我不希望突出显示/选择点击区域。以下风格似乎不起作用。我已经在各种Android设备(2.2,2.3,4.0等)上测试过了,每当我点击图像区域时,矩形就会亮起。任何人有任何想法?

<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <style> 
    a{outline:none;} 
    a:active{outline:none;} 
    a:focus{outline:none;} 
    area,area:active,area:focus {outline: none; border:0; } 
    *{-webkit-tap-highlight-color:rgba(0,0,0,0);} 
    </style> 
    </head> 
    <body> 
    <img usemap="#map1" src="sourceimage" > 
    <map name="map1"> 
    <area href="do1" alt="text1" coords="338,142,209,182" 
      shape="rect"> 
    ... 

    </map> 
    </body> 
</html> 
+0

我刚刚找到它的答案:

$("map area").on("touchend", function() { return false;}); 

与根据。它与html图像映射本身无关。 我只是忘了设置*** webView.setFocusableInTouchMode(false); ***这解决了突出显示选择的问题。 – tenshox 2012-04-27 14:04:30

回答

0

我刚刚找到答案。它与html图像映射本身无关。 我只是忘了设置webView.setFocusableInTouchMode(false);这解决了突出选择的问题。