PHP向右侧拉菜单实现代码,测试使用中
2023-06-13 09:14:13 时间
这个是由asp二级侧拉菜单改的
复制代码代码如下:
<scriptlanguage="javascript">
//JavaScriptDocument
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>
<styletype="text/css">
<!--
ul{
margin:0;
padding:0;
list-style:none;
width:200px;/*WidthofMenuItems*/
border-bottom:0pxsolid#ccc;
}
ulli{
position:relative;
}
liul{
position:absolute;
left:199px;/*Set1pxlessthanmenuwidth*/
top:0;
display:none;
}
/*StylesforMenuItems*/
ullia{
display:block;
text-decoration:none;
color:#777;
background:#8A0000;/*IE6Bug*/
padding:5px;
border:0px#ccc;/*IE6Bug*/
border-bottom:0;
}
/*HollyHack.IERequirement\*/
*htmlulli{float:left;height:1%;}
*htmlullia{height:1%;}
/*End*/
li:hoverul,li.overul{display:block;}/*Themagic*/
.ulbox{border:1pxsolid#ffffff;overflow:hidden;margin-left:1px;background-color:#E87DDD}
-->
</style>
<tablewidth="200"cellspacing="0"cellpadding="0"border="0"align="center">
<tr>
<tdalign="left">
<ulid="nav">
<?php
require("../Connections/lr.php");
mysql_select_db($database_lr,$lr);
$query=mysql_query("SELECT*FROMbigclassorderbysort");
$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><ahref=""><?phpecho$row["bigclassname"]?></a>
<ulclass="ulbox">
<?php
mysql_select_db($database_lr,$lr);
$query_small=mysql_query("SELECT*FROMsmallclasswherebigclassid="$bigclassid"orderbysort");
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><ahref=""class="my2"><?phpecho$rs["smallclassname"]?></a></li>
<?php
}?>
</ul>
</li>
<?php
}?>
</ul>
</td></tr></table>
相关文章
- MySQL与PHP的基础与应用专题之创建数据库表
- php结合redis实现高并发下的抢购、秒杀功能的实例
- PHP无法连接MySQL数据库解决办法(php连接不到mysql)
- PHP Imagick文字加阴影(外发光)详解编程语言
- php删除目录及目录下的内容详解编程语言
- Linux下运行PHP脚本的简单步骤(linux运行php脚本)
- 开发深入浅出:Linux环境下的PHP开发(linux环境php)
- PHP专业连接MySQL:实现快速代码.(php连接mysql数据库代码)
- Linux更新PHP,提升程序品质(linux更新php)
- 使用PHP测试Redis的最佳实践(php测试redis)
- Linux环境下,如何进行PHP测试?(linux测试php环境)
- Linux环境下,如何高效、简单地编写PHP代码(linux下写php)
- 利用PHP实现MySQL数据库操作的简易指南(php实现mysql)
- PHP编程查询MySQL数据库:入门指南(php 查询 mysql)
- PHP与MSSQL的快速无缝连接配置指南(php链接mssql配置)
- PHP连接MSSQL:一个新的开发方式(php 联接mssql)
- 用PHP从MSSQL读取数据表列表(php查询mssql列表)
- PHP操作MySQL数据库,轻松获取数据。(php访问mysql数据库)
- 混合开发助力企业信息化C语言PHP和MySQL联动提升系统性能(c php mysql)
- 强悍的表现PHP与Redis的连接(redis链接php)
- php中看实例学正则表达式
- 一个简单的php加密解密函数(动态加密)
- 测试PHP连接MYSQL成功与否的代码
- php中mysql连接和基本操作代码(快速测试使用,简单方便)