如何使用函数制作简单的旋转木马
How to make simple carousel using functions?
有人能让我简单、易于理解的旋转木马JS吗。我真的不懂"this"的用法,所以,你能解释一下发生了什么吗?
div{
height: 100px;
width: 100px;
display: inline-block;
}
div:nth-child(1) {
background-color: red;
}
div:nth-child(2) {
background-color: blue;
}
div:nth-child(3) {
background-color: green;
}
.no {
display: none;
}
<div>
<div class="yes"></div>
<div class="no"></div>
<div class="no"></div>
<ul>
<li>left</li>
<li>right</li>
</ul>
</div>
<div>
<div class="yes"></div>
<div class="no"></div>
<div class="no"></div>
<ul>
<li>left</li>
<li>right</li>
</ul>
</div>
div:nth-child(1) {
background-color: red;
}
that means this CSS apply only on all first child div whose parent is <div> tag
First parent div's inside four child , three div and one <Ul> so basically according to our CSS it apply it on first div (color red).
second and third <div> block is hidden due to class ".no" containing display none property
相关文章:
- 知道为什么我的旋转木马不会自动更改图片吗
- 禁用旋转木马中的下一个按钮和上一个按钮
- 旋转木马;启用内容安全策略时无法工作
- 在引导程序旋转木马中显示下一个图像
- 猫头鹰旋转木马2罐头't使渐变动画工作
- 猫头鹰旋转木马宽度计算错误
- 猫头鹰旋转木马动画未在Chrome中应用
- 猫头鹰旋转木马:无法读取属性'visibleItems'的未定义
- 在Javascript中设置多个小图像(如旋转木马)
- 如何使引导旋转木马保持图像纵横比
- 使用旋转木马在元素上切换类
- 将图像传递到Angular UI引导旋转木马
- 当ons惰性重复检测到更改时,如何使用ons旋转木马刷新列表
- 猫头鹰旋转木马2-拖动方向
- 带有JQuery和CSS的3D旋转木马-渲染不正确
- 如何在猫头鹰旋转木马中滑动所有可见项目,而不是使用上一个/下一个按钮
- Bootstrap 3旋转木马/滑块IE9支持
- Ruby on Rails - 引导旋转木马按钮不起作用
- 如何使用函数制作简单的旋转木马
- 暂停悬停在简单的jquery旋转木马