我对一系列的div应用了材质设计,这些div代表了sidenav面板中的链接。
我的问题是,涟漪点击效果的应用范围太广了,不仅影响了div的内容,还影响了它的父元素md-item-content。
md-ink-ripple属性被应用一次,作为超文本标记语言中的属性,如下所示。
我处理了ripple属性的位置,向上到它的祖父md-item,向下到子<label>元素,似乎无论我把它放在哪里,它都会继续通过相同的md-item-content元素。
编辑-我想我已经解决了这个问题,通过将目标标签切换为md-item-content,而不是div。把这个留给子孙后代,任何有兴趣的人都可以捐出2美分。
<md-content>
<md-list>
<md-item ng-repeat="item in data.exhibits" id="toc-item-{{::$index}}">
<md-item-content>
<div class="toc-indices">
<span>{{::$index + 1}}</span>
</div>
<div class="md-tile-content exhibit-link" md-ink-ripple ng-click="goToSection($index, -1)" ng-class="{'md-item-active': (data.currentExhibitIndex === $index)}">
<label>{{::item.title}}</label>
</div>
</md-item-content>
<md-item-content ng-repeat="section in item.sections">
<label class="md-tile-content exhibit-section-link" ng-click="goToSection($parent.$index, $index)" id="toc-item-{{::$parent.$index}}-section-{{::$index}}" ng-class="{'md-item-active': (data.currentExhibitIndex === $parent.$index && data.sectionIndex === $index)}">
{{::section.title}}
</label>
</md-item-content>
<section class="clo-parts-divider"></section>
</md-item>
</md-list>
发布于 2016-06-07 16:26:59
如果将div的相对位置设置为如下所示,
<div md-ink-ripple="#f5f5f5" style="position:relative"></div>涟漪将停留在div容器中。
https://stackoverflow.com/questions/29441670
复制相似问题