[英]Fade out all the “LI” elements
Please tell me how to use PrototypeJS to hide (fade out) all the li
elements. 请告诉我如何使用PrototypeJS隐藏(淡出)所有li
元素。
PS there can be any number of li
elements. PS可以有任意数量的li
元素。
HTML: HTML:
<div class="rtr-img" >
<ul id="rotator_ul">
<li id="rtr-img-1"><a href="/link/1/"><img src="b1.jpg"/></a></li>
<li id="rtr-img-2"><a href="/link/2/"><img src="b2.jpg"/></a></li>
<li id="rtr-img-3"><a href="/link/3/"><img src="b3.jpg"/></a></li>
</ul>
</div>
As far as I'm aware, PrototypeJS does not have animations/effects built in. You can use the Scriptaculous library, which is an add-on to Prototype, and provides a fade
method . 据我所知,PrototypeJS没有内置的动画/效果。您可以使用Scriptaculous库,它是Prototype的附加组件,并提供了fade
方法 。
If you want to fade out the entire ul
element: 如果你想淡出整个ul
元素:
$("rotator_ul").fade({
from: 1,
to: 0
});
If you want to (as stated in your question) fade out all li
elements: 如果你想(如你的问题中所述)淡出所有li
元素:
$$("li").invoke("fade", {
from: 1,
to: 0
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.