小编abm*_*ayo的帖子

CSS - 边境过渡不正常

CSS代码:

.css3_nudge ul li a {
   -webkit-transition-property: color, background-color, padding-left, border-right;
   -webkit-transition-duration: 400ms, 400ms, 400ms, 400ms;
}

.css3_nudge ul li a:hover {
   background-color: #efefef;
   color: #333;
   padding-left: 50px;
   border-right: 1px solid red;
}
Run Code Online (Sandbox Code Playgroud)

HTML代码:

<div class="css3_nudge nudge">
   <ul>
      <li><a href="#" title="Home">Home</a></li>
      <li><a href="#" title="Blog">Blog</a></li>
      <li><a href="#" title="About">About</a></li>
      <li><a href="#" title="Register">Register</a></li>
      <li><a href="#" title="Contact">Contact</a></li>
   </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

过渡对所有元素都很好但边界很好,它只出现在400ms的末尾,对边界没有影响.

我想要实现的是像新的谷歌Gmail按钮的效果.

在此先感谢您的帮助

css css-transitions

5
推荐指数
1
解决办法
3210
查看次数

如何在CPython 2.7.2中停用方法缓存?

我正在尝试实现我自己的方法缓存.为此,首先我要禁用CPython 2.7.2中实现的现有方法缓存,因为我还想在没有此方法缓存的情况下对CPython进行基准测试.

我一直在查看代码并在'typeobject.c'文件中找到一些方法缓存代码:

/* Internal API to look for a name through the MRO.
   This returns a borrowed reference, and doesn't set an exception! */
PyObject *
_PyType_Lookup(PyTypeObject *type, PyObject *name)
{
    Py_ssize_t i, n;
    PyObject *mro, *res, *base, *dict;
    unsigned int h;

    if (MCACHE_CACHEABLE_NAME(name) &&
        PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) {
        /* fast path */
        h = MCACHE_HASH_METHOD(type, name);
        if (method_cache[h].version == type->tp_version_tag &&
            method_cache[h].name == name)
            return method_cache[h].value;
    }

    /* Look in tp_dict of types in MRO */
    mro = type->tp_mro; …
Run Code Online (Sandbox Code Playgroud)

python methods caching cpython

4
推荐指数
1
解决办法
185
查看次数

标签 统计

caching ×1

cpython ×1

css ×1

css-transitions ×1

methods ×1

python ×1