buttons数组怎么理解?

来源:4-1 无限滚动

小进郭

2015-03-27 20:18

-----css代码

#buttons { position: absolute; height: 10px; width: 100px; z-index: 2; bottom: 20px; left: 400px;}

        #buttons span { cursor: pointer; float: left;  width: 10px; height: 10px; border-radius: 50%; background: #333; margin-right: 5px;}

-----html代码

 <div id="buttons">

        <span index="1" class="on"></span>

        <span index="2"></span>

        <span index="3"></span>

        <span index="4"></span>

        <span index="5"></span>

    </div>

请问怎么 span中index 如何理解? 为什么buttons是一个数组 ?

写回答 关注

1回答

  • 和煦阳光_82494
    2015-04-20 08:45:30

    这里的index应该是自定义属性,比如html5的data。getElementById('buttons').getElementsByTagName('span')这里返回的是多个标签

焦点图轮播特效

通过本教程学习您将能掌握非常实用的焦点图轮播特效的制作过程

65296 学习 · 611 问题

查看课程

相似问题