我在这里有这段代码,我想用 jquery 做的是获取从 1 开始的列表项总数,并找到哪个索引slideshow_currentView
类在其中。
例如,我有 38 个项目并且slideshow_currentView
在项目 7 上,我想显示 7 / 38,我对 jquery 完全陌生,只是想知道这是否可能?
<div class="slideshow_pagination" style="display: block;">
<div class="slideshow_pagination_center">
<ul>
<li class="slideshow_transparent slideshow_currentView">
<span style="display: none;">0</span>
</li>
<li class="slideshow_transparent "><span style="display: none;">1</span></li>
<li class="slideshow_transparent "><span style="display: none;">2</span></li>
<li class="slideshow_transparent "><span style="display: none;">3</span></li>
<li class="slideshow_transparent "><span style="display: none;">4</span></li>
<li class="slideshow_transparent "><span style="display: none;">5</span></li>
<li class="slideshow_transparent "><span style="display: none;">6</span></li>
<li class="slideshow_transparent "><span style="display: none;">7</span></li>
<li class="slideshow_transparent "><span style="display: none;">8</span></li>
<li class="slideshow_transparent "><span style="display: none;">9</span></li>
<li class="slideshow_transparent "><span style="display: none;">10</span></li>
<li class="slideshow_transparent "><span style="display: none;">11</span></li>
<li class="slideshow_transparent "><span style="display: none;">12</span></li>
<li class="slideshow_transparent "><span style="display: none;">13</span></li>
<li class="slideshow_transparent "><span style="display: none;">14</span></li>
<li class="slideshow_transparent "><span style="display: none;">15</span></li>
<li class="slideshow_transparent "><span style="display: none;">16</span></li>
<li class="slideshow_transparent "><span style="display: none;">17</span></li>
<li class="slideshow_transparent "><span style="display: none;">18</span></li>
<li class="slideshow_transparent "><span style="display: none;">19</span></li>
<li class="slideshow_transparent "><span style="display: none;">20</span></li>
<li class="slideshow_transparent "><span style="display: none;">21</span></li>
<li class="slideshow_transparent "><span style="display: none;">22</span></li>
<li class="slideshow_transparent "><span style="display: none;">23</span></li>
<li class="slideshow_transparent "><span style="display: none;">24</span></li>
<li class="slideshow_transparent "><span style="display: none;">25</span></li>
<li class="slideshow_transparent "><span style="display: none;">26</span></li>
<li class="slideshow_transparent "><span style="display: none;">27</span></li>
<li class="slideshow_transparent "><span style="display: none;">28</span></li>
<li class="slideshow_transparent "><span style="display: none;">29</span></li>
<li class="slideshow_transparent "><span style="display: none;">30</span></li>
<li class="slideshow_transparent "><span style="display: none;">31</span></li>
<li class="slideshow_transparent "><span style="display: none;">32</span></li>
<li class="slideshow_transparent "><span style="display: none;">33</span></li>
<li class="slideshow_transparent "><span style="display: none;">34</span></li>
<li class="slideshow_transparent "><span style="display: none;">35</span></li>
<li class="slideshow_transparent "><span style="display: none;">36</span></li>
<li class="slideshow_transparent "><span style="display: none;">37</span></li>
<li class="slideshow_transparent "><span style="display: none;">38</span></li>
</ul>
</div>
</div>