我得到了这个想法,在一个没有 CMS 的网站上……我有大约 50 张图片,不能一次全部显示。所以想法是显示前 15 个,然后单击下一步,隐藏这些并显示下一个 15 等
用 ajax 或 wit php 和 css 来做这件事很热吗?
计数,添加隐藏的类,并显示?
或另一种方法...在 php 或 jQuery 中,如何使用类“image”获取 div 的前 15 个元素并添加类:showimage,然后单击 NEXT 按钮:删除所有类 showimage,并显示图 16 至 30
代码看起来像这样:
<div id="gallery2"> <!-- Gallery de photos -->
<a href="ia/new_01.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="timthumb.php?src=ia/new_01.jpg&h=<?php echo $size ?>" title="Cliquer pour agrandir"
alt="Pont Neuf - Ile de la Cité - Paris - France - Aquarelle <br> Conception personnelle"/></a>
<a href="ia/new_02.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="timthumb.php?src=ia/new_02.jpg&h=<?php echo $size ?>" title="Cliquer pour agrandir"
alt="Studebaker Hawk - Concept rétro <br> Conception personnelle"/></a>
<a href="ia/new_03.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="timthumb.php?src=ia/new_03.jpg&h=<?php echo $size ?>" title="Cliquer pour agrandir"
alt="Corvette - Concept rétro <br> Conception personnelle"/></a>
<a href="ia/new_04.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="timthumb.php?src=ia/new_04.jpg&h=<?php echo $size ?>" title="Cliquer pour agrandir"
alt="Thunderbird - Concept rétro <br> Conception personnelle"/></a>
<a href="ia/new_05.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="timthumb.php?src=ia/new_05.jpg&h=<?php echo $size ?>" title="Cliquer pour agrandir"
alt="Les autos de mon père <br> Conception personnelle"/></a>
不断地不断地...... 50张图片