PHP 向右侧拉菜单实现代码,测试使用中
PHP 向右侧拉菜单实现代码,测试使用中
发布时间:2016-12-29 来源:查字典编辑
摘要:这个是由asp二级侧拉菜单改的复制代码代码如下://JavaScriptDocumentstartList=function(){if(do...

这个是由asp二级侧拉菜单改的

复制代码 代码如下:

<script language="javascript">

// JavaScript Document

startList = function() {

if (document.all && document.getElementById) {

navRoot = document.getElementById("nav");

for (i=0; i<navRoot.childNodes.length; i++) {

node = navRoot.childNodes[i];

if (node.nodeName=="LI") {

node.onmouseover=function() {

this.className+=" over";

}

node.onmouseout=function() {

this.className=this.className.replace(" over", "");

}

}

}

}

}

window.onload=startList;

</script>

<style type="text/css">

<>

</style>

<table width="200" cellspacing="0" cellpadding="0" border="0" align="center">

<tr>

<td align="left">

<ul id="nav">

<?php

require('../Connections/lr.php');

mysql_select_db($database_lr, $lr);

$query = mysql_query("SELECT * FROM bigclass order by sort");

$j=0;

while($row=mysql_fetch_array($query))

{$j=$j+1;

$bigclassid=$row['bigclassid'];

$bigclassname_leftmenu=$row['bigclassname'];

if ($htmlname==1){

$bigclass_htmlname_leftmenu=$bigclassname_leftmenu;//大类名称

if (substr_count($bigclass_htmlname_leftmenu," ")>0){

$bigclass_htmlname_leftmenu= str_replace(" ","-",$bigclass_htmlname_leftmenu);

}

}

if ($htmlname==0){

$bigclass_htmlname_leftmenu=$bigclassid;

}

?>

<li><a href=""><?php echo $row['bigclassname']?></a>

<ul>

<?php

mysql_select_db($database_lr, $lr);

$query_small = mysql_query("SELECT * FROM smallclass where bigclassid='$bigclassid' order by sort");

while($rs=mysql_fetch_array($query_small))

{

$smallclassid_small_leftmenu=$rs['smallclassid'];

$smallclassname_small=$rs['smallclassname'];//小类名称

if ($htmlname==1){

$smallclass_htmlname=$smallclassname_small;

if (substr_count($smallclass_htmlname," ")>0){

$smallclass_htmlname= str_replace(" ","-",$smallclass_htmlname);

}

}

if ($htmlname==0){

$smallclass_htmlname=$smallclassid_small_leftmenu;

}

?>

<li><a href=""><?php echo $rs['smallclassname']?></a></li>

<?php

} ?>

</ul>

</li>

<?php

} ?>

</ul>

</td></tr></table>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新php教程学习
热门php教程学习
编程开发子分类