昨天花了半天时间在网上都搜不到好的方法,大都只有父栏目嵌套子栏目的循环,对于只有子栏目的结构就做不了下拉菜单了
而昨晚却被我无意中弄成功了 不懂加我Q:54240690
我是参考这个帖子做的:http://bbs.phome.net/ShowThread/?threadid=175230&forumid=13
演示地址:http://www.exci88.com/biaogkh/2012-12-13/11.html
代码:
<?php $ecms_bq_sql=sys_ReturnEcmsLoopBq('select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder',20,24,0); $bqno=0; while($bqr=$empire->fetch($ecms_bq_sql)) { $bqsr=sys_ReturnEcmsLoopStext($bqr); $bqno++; ?> <li> <a > <span class='menu-title'><?=$class_r[$bqr[classid]][classname]?></span> <div></div><span class='menu-description'><?=$bqsr[classname]?></span> </a> <ul class='afontf'> <?php $ecms_bq_sql2=sys_ReturnEcmsLoopBq("$bqr[classid]",20,2,0,0,"isgood asc,newstime desc"); $bqno2=0; while($bqr2=$empire->fetch($ecms_bq_sql2)) { $bqsr2=sys_ReturnEcmsLoopStext($bqr2); $bqno2++; ?> <li><a href="<?=$bqsr2[titleurl]?>"><?=$bqr2[title]?></a></li> <?php } ?>
</ul> </li> <li class='divline' style='width:1px; border:0'></li> <?php } ?>
说明:蓝色部分根据自己想要修改
|