大家看看以下代码修改成动态从数据库提取应该如何修改?ID是“slide1(2、3、4、5、6)”这几个DIV应该如何写循环?
程序代码:
<div id="gallery"> <div id="slides"> <div id="slide1"> <ul> <li><img class="blank" src="double-click/upx.png" alt="" /></li> <li><a href="#pic1"><img src="double-click/pic1.jpg" alt="Winter branches" /></a></li> <li><a href="#pic2"><img src="double-click/pic2.jpg" alt="Wading birds" /></a></li> <li><a href="#pic3"><img src="double-click/pic3.jpg" alt="Bird on a post" /></a></li> <li><a href="#pic4"><img src="double-click/pic4.jpg" alt="Early bloomers" /></a></li> <li><a href="#pic5"><img src="double-click/pic5.jpg" alt="Green lizard" /></a></li> <li><a href="#slide2" class="next"><b>Next</b></a></li> </ul> </div> <div id="slide2"> <ul> <li><a href="#slide1" class="previous"><b>Previous</b></a></li> <li><a href="#pic2"><img src="double-click/pic2.jpg" alt="Wading birds" /></a></li> <li><a href="#pic3"><img src="double-click/pic3.jpg" alt="Bird on a post" /></a></li> <li><a href="#pic4"><img src="double-click/pic4.jpg" alt="Early bloomers" /></a></li> <li><a href="#pic5"><img src="double-click/pic5.jpg" alt="Green lizard" /></a></li> <li><a href="#pic6"><img src="double-click/pic6.jpg" alt="Feeding the birds" /></a></li> <li><a href="#slide3" class="next"><b>Next</b></a></li> </ul> </div> <div id="slide3"> <ul> <li><a href="#slide2" class="previous"><b>Previous</b></a></li> <li><a href="#pic3"><img src="double-click/pic3.jpg" alt="Bird on a post" /></a></li> <li><a href="#pic4"><img src="double-click/pic4.jpg" alt="Early bloomers" /></a></li> <li><a href="#pic5"><img src="double-click/pic5.jpg" alt="Green lizard" /></a></li> <li><a href="#pic6"><img src="double-click/pic6.jpg" alt="Feeding the birds" /></a></li> <li><a href="#pic7"><img src="double-click/pic7.jpg" alt="A group of butterflies" /></a></li> <li><a href="#slide4" class="next"><b>Next</b></a></li> </ul> </div> <div id="slide4"> <ul> <li><a href="#slide3" class="previous"><b>Previous</b></a></li> <li><a href="#pic4"><img src="double-click/pic4.jpg" alt="Early bloomers" /></a></li> <li><a href="#pic5"><img src="double-click/pic5.jpg" alt="Green lizard" /></a></li> <li><a href="#pic6"><img src="double-click/pic6.jpg" alt="Feeding the birds" /></a></li> <li><a href="#pic7"><img src="double-click/pic7.jpg" alt="A group of butterflies" /></a></li> <li><a href="#pic8"><img src="double-click/pic8.jpg" alt="Ladybirds" /></a></li> <li><a href="#slide5" class="next"><b>Next</b></a></li> </ul> </div> <div id="slide5"> <ul> <li><a href="#slide4" class="previous"><b>Previous</b></a></li> <li><a href="#pic5"><img src="double-click/pic5.jpg" alt="Green lizard" /></a></li> <li><a href="#pic6"><img src="double-click/pic6.jpg" alt="Feeding the birds" /></a></li> <li><a href="#pic7"><img src="double-click/pic7.jpg" alt="A group of butterflies" /></a></li> <li><a href="#pic8"><img src="double-click/pic8.jpg" alt="Ladybirds" /></a></li> <li><a href="#pic9"><img src="double-click/pic9.jpg" alt="Butterfly" /></a></li> <li><a href="#slide6" class="next"><b>Next</b></a></li> </ul> </div> <div id="slide6"> <ul> <li><a href="#slide5" class="previous"><b>Previous</b></a></li> <li><a href="#pic6"><img src="double-click/pic6.jpg" alt="Feeding the birds" /></a></li> <li><a href="#pic7"><img src="double-click/pic7.jpg" alt="A group of butterflies" /></a></li> <li><a href="#pic8"><img src="double-click/pic8.jpg" alt="Ladybirds" /></a></li> <li><a href="#pic9"><img src="double-click/pic9.jpg" alt="Butterfly" /></a></li> <li><a href="#pic10"><img src="double-click/pic10.jpg" alt="Trees in the mist" /></a></li> <li><img class="blank" src="double-click/downx.png" alt="" /></li> </ul> </div> </div> <div id="fullsize"> <div id="pic1"> <img src="double-click/pic1.jpg" alt="Winter branches" /> <h3>懒人建站</h3> <p><a href="http://" target="_blank">懒人建站</a> 层次的设计</p> </div> <div id="pic2"> <img src="double-click/pic2.jpg" alt="Wading birds" /> <h3>JS代码</h3> <p><a href="http://" target="_blank">JS代码</a> JS广告代码建站</p> </div> <div id="pic3"> <img src="double-click/pic3.jpg" alt="Bird on a post" /> <h3>广告代码</h3> <p><a href="http://" target="_blank">广告代码</a>JS广告代码</p> </div> <div id="pic4"> <img src="double-click/pic4.jpg" alt="Early bloomers" /> <h3>导航菜单</h3> <p><a href="http://" target="_blank">导航菜单</a>导航菜单建站</p> </div> <div id="pic5"> <img src="double-click/pic5.jpg" alt="Green lizard" /> <h3>CSS技巧</h3> <p><a href="http://" target="_blank">css模板_懒人建站</p> </div> <div id="pic6"> <img src="double-click/pic6.jpg" alt="Feeding the birds" /> <h3>焦点幻灯片</h3> <p><a href="http://" target="_blank">网页特效</a>flash焦点图</p> </div> <div id="pic7"> <img src="double-click/pic7.jpg" alt="A group of butterflies" /> <h3>网页特效</h3> <p><a href="http://" target="_blank">网页特效</a>网页特效代码下载</p> </div> <div id="pic8"> <img src="double-click/pic8.jpg" alt="Ladybirds" /> <h3>设计建站</h3> <p><a href="http://" target="_blank">建站</a> 更高层次的设计</p> </div> <div id="pic9"> <img src="double-click/pic9.jpg" alt="Butterfly" /> <h3>导航菜单</h3> <p><a href="http://" target="_blank">导航菜单</a>导航菜单</p> </div> <div id="pic10"> <img src="double-click/pic10.jpg" alt="Trees in the mist" /> <h3>CSS技巧</h3> <p><a href="DDD" target="_blank">CSS技巧</a>CSS技巧</p> </div> </div> </div>以上是图片展示的主要代码,修改成从数据库动态提取图片应该如何修改?ID是“slide1(2、3、4、5、6)”这几个DIV应该如何写循环,很是纠结,请高手多多指教!
此图片轮换代码在线预览地址:http://www.
[ 本帖最后由 llzzcsl 于 2010-8-24 13:47 编辑 ]