- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在创建一个具有涟漪效果的 Material 按钮。涟漪动画 .circle
看起来像是在其父级 button
之上进行动画处理,而不是在下方,这就是文本被覆盖的原因。我确信我拥有使用 z-index 的所有正确语法。这是codepen链接http://codepen.io/theMugician/pen/Bjadpj
button{
z-index: 2;
border: 3px solid #222;
background: transparent;
overflow: hidden;
width: 100%;
outline: none;
position: relative;
span{
z-index: 2;
font-family: 'Montserrat', sans-serif;
text-transform: uppercase;
font-weight: 700;
font-size: 1.5em;
color: #222;
position: relative;
display: block;
user-select: none;
position: relative;
overflow: hidden;
padding: 20px;
&:hover{cursor: pointer;}
}
}
.circle{
z-index: 1;
display: block;
position: absolute;
background: #5677fc;
border-radius: 50%;
transform: scale(0);
&.animate{
z-index: 1;
animation: effect 0.65s linear;}
}
@keyframes effect{
100%{
z-index: 1;
opacity: 1;
transform: scale(2.5);
}
}
最佳答案
您正在将圆 span
添加到 button span
。所以 circle span
成为按钮的 span
的 child ,你的 z-indexes 没有效果。只需将点击事件绑定(bind)到 button
元素本身即可解决您的问题:
$("button").click(function(e){
....
所以按钮结构变成了这样:
<button>
<span>button</span>
<span class="circle animate"></span>
</button>
不是这个:
<button>
<span>button
<span class="circle animate"></span>
</span>
</button>
更新的 Codepen: http://codepen.io/anon/pen/mVdBPO
关于jquery - Material 按钮波纹 z-index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34096164/
如何以编程方式将 TextView 背景设置为 xml/ripple? xml/ripple.xml: 我尝试了
我正在开发 Material Design 界面。我有一些卡片,我希望在单击时产生链式 react 。我已经按照谷歌所说的做了,但没有任何反应。这是我的代码: >
我试图将 FloatingActionButton 波纹设置为类似于 this 来自 Material 设计。 问题是我只得到一个没有波纹的“平面样式”,它只是将按钮从白色更改为橙色,而没有上面链
想象一下我有这么长的一段文字:HELLO THIS IS MY LONG SENTENCE。当我点击它时,我希望 LONG 这个词产生波纹(墨水溅起)。 假设我有这个代码: new RichText(
有人知道 Ripple 是否适用于最新的cordova 版本?因为我正在尝试,我什至无法启动控制面板。当我尝试不使用它时,会弹出一些“警报”: 差距:[“插件管理器”,“启动”,“插件管理器59084
我正在使用 google maps API,我试图让他们的交互式 map 通过 PhoneGap 工作,然后我通过 Ripple 模拟它。 我完全复制了这个教程: http://www.christi
在 Jetpack 中撰写 clickable修饰符默认使用 LocalIndication.current并显示一个绑定(bind)到边界的波纹。这看起来几乎总是很棒,但在某些情况下,圆形的、未绑定
我有一个项目列表(每个项目都包含多个元素),其中每个项目都可以单击并切换 View 。有没有办法对整个md-item-content产生链式 react ?我尝试了 class="ripple" 但这
我正在为我的移动应用程序项目使用 jquery、backbonejs、underscorejs 和 bootstrap 3。我在 ripple 中运行我的应用程序。有时我的控制台会出现这个愚蠢的错误。
我是一名优秀的程序员,十分优秀!