admin管理员组文章数量:1426015
In the doc, it appears that we can transition UL elements like so:
<a href="#!" class="btn" onclick="Materialize.showStaggeredList('#staggered-test')">Click Me</a>
<ul id="staggered-test">
<li class="" style="transform: translateX(0px); opacity: 1;">
<h4><a href="#">List Item</a></h4>
<p>This is a description</p>
</li>
<li class="" style="transform: translateX(0px); opacity: 1;">
<h4><a href="#">List Item</a></h4>
<p>This is a description</p>
</li>
</ul>
But what I want to transition is a div. I've tried doing this but it doesn't appear to work
<a href="#!" class="btn" onclick="Materialize.showStaggeredList('#staggered-test')">Click Me</a>
<div id="staggered-test">
<p style="transform: translateX(0px); opacity: 0;">
appear!
</p>
</div>
In the doc, it appears that we can transition UL elements like so:
<a href="#!" class="btn" onclick="Materialize.showStaggeredList('#staggered-test')">Click Me</a>
<ul id="staggered-test">
<li class="" style="transform: translateX(0px); opacity: 1;">
<h4><a href="#">List Item</a></h4>
<p>This is a description</p>
</li>
<li class="" style="transform: translateX(0px); opacity: 1;">
<h4><a href="#">List Item</a></h4>
<p>This is a description</p>
</li>
</ul>
But what I want to transition is a div. I've tried doing this but it doesn't appear to work
<a href="#!" class="btn" onclick="Materialize.showStaggeredList('#staggered-test')">Click Me</a>
<div id="staggered-test">
<p style="transform: translateX(0px); opacity: 0;">
appear!
</p>
</div>
Share
Improve this question
asked May 5, 2015 at 14:34
Stupid.Fat.CatStupid.Fat.Cat
11.4k28 gold badges94 silver badges163 bronze badges
5
- I assume you're using the Materialize CSS library? In the docs it only appears to support the list items and image fading. If it helps, you could manually achieve the effect you're after. Could you give a sample of how you want it to look/behave? – Graham Commented May 5, 2015 at 14:48
- Essentially what I'm trying to do is this: I have several tabs, and the tabs transition nicely, but the content switches instantaneously when you click on different tabs. So it feels off. Any transition to offset this would work. – Stupid.Fat.Cat Commented May 5, 2015 at 14:55
- Have you considered using Bootstrap? You can pass a fade parameter to them for this effect? Failing that, you could set the tab content to opacity: 0, then add an onclick event to the tab triggering opacity: 1 on the content? To animate the above you could use CSS3 transitions, e.g: transition: all 0.3s ease-in-out; I hope this helps! – Graham Commented May 5, 2015 at 15:45
- @Graham :) I've been avoiding using bootstrap over the fancy materialize css – Stupid.Fat.Cat Commented May 5, 2015 at 16:35
- Fair enough. Can I tempt you with Foundation Zurb instead, perhaps? :) – Graham Commented May 6, 2015 at 13:19
1 Answer
Reset to default 4You only have to create the div inside li
Regards
本文标签: javascriptMaterialize CSSTransition animation for things other than ULStack Overflow
版权声明:本文标题:javascript - Materialize CSS - Transition animation for things other than UL - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745470835a2659740.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论