-webkit-tap-highlight-color:rgba(0,0,0,0);在一个div?

时间:2009-12-29 13:40:03

标签: javascript iphone css javascript-events webkit

有没有办法将它应用于div?

3 个答案:

答案 0 :(得分:24)

你在为iPhone /智能手机网站写作吗?如果是,那么是的。但您可能只会在手机/模拟器上看到结果。我认为这个元素只能用于链接或javascript元素。 div必须受到某种脚本的影响,或者是一个链接。

https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html

<!DOCTYPE HTML>
<html>
  <head>
    <title>Highlighting Elements</title>
     <style type="text/css">
      .borderImage
        {
          -webkit-tap-highlight-color:rgba(0,0,0,0);

        }       
      </style>
    </head>
<body>
   <div class="borderImage">
     <a href="#">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum non felis risus, tristique luctus lacus. Vestibulum non aliquam arcu. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent eleifend augue a ligula ornare quis lacinia risus ullamcorper.
     </a>
   </div>
</body>
</html>

答案 1 :(得分:4)

我将此应用于我的iphone web-app的所有(*)html对象。

只需将其添加到您的css代码中:

*{
/* Prevent any object from being highlighted upon touch event*/
-webkit-tap-highlight-color: rgba(0,0,0,0); }

我使用jQuery mobile来添加和处理touchstart和touchend事件到我的按钮,它处理我的按钮的背景图像(实际上这些是div s),所以看起来它们在touchstart上按下了

答案 2 :(得分:0)

这应该有效:

Traceback (most recent call last):
  File "C:\Program Files\eclipse indigo\plugins\org.python.pydev.debug_2.5.0.2012040618\pysrc\pydevd.py", line 1346, in <module>
    debugger.run(setup['file'], None, None)
  File "C:\Program Files\eclipse indigo\plugins\org.python.pydev.debug_2.5.0.2012040618\pysrc\pydevd.py", line 1060, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "C:\Users\rzuccotti\workspace\FIRST_ANDREA\interlem\dao\orderDao.py", line 3159, in <module>
    print cursor.fetchall()
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 106, in inner
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 99, in exit
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 106, in inner
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\sqlserver_ado\dbapi.py", line 688, in fetchall
    return self._fetch()
  File "C:\Python27\lib\site-packages\sqlserver_ado\dbapi.py", line 642, in _fetch
    self._raiseCursorError(FetchFailedError, 'Attempting to fetch from a closed connection or empty record set')
  File "C:\Python27\lib\site-packages\sqlserver_ado\dbapi.py", line 466, in _raiseCursorError
    eh(self.connection, self, errorclass, errorvalue)
  File "C:\Python27\lib\site-packages\sqlserver_ado\dbapi.py", line 91, in standardErrorHandler
    raise errorclass(errorvalue)
django.db.utils.Error: Attempting to fetch from a closed connection or empty record set