PHP 向右侧拉菜单实现代码,测试使用中
2015-01-24信息快讯网
PHP 向右侧拉菜单实现代码,测试使用中,需要的朋友可以测试下。
这个是由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">
<!--
ul {
margin: 0;
padding: 0;
list-style: none;
width: 200px; /* Width of Menu Items */
border-bottom: 0px solid #ccc;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 199px; /* Set 1px less than menu width */
top: 0;
display: none;
}
/* Styles for Menu Items */
ul li a {
display: block;
text-decoration: none;
color: #777;
background: #8A0000; /* IE6 Bug */
padding: 5px;
border: 0px #ccc; /* IE6 Bug */
border-bottom: 0;
}
/* Holly Hack. IE Requirement \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
li:hover ul, li.over ul { display: block; } /* The magic */
.ulbox{border:1px solid #ffffff;overflow:hidden;margin-left:1px;background-color:#E87DDD}
-->
</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 class="ulbox">
<?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="" class="my2"><?php echo $rs['smallclassname']?></a></li>
<?php
} ?>
</ul>
</li>
<?php
} ?>
</ul>
</td></tr></table>
php file_put_contents()功能函数(集成了fopen、fwrite、fclose)
PHP取得一个类的属性和方法的实现代码
php性能优化分析工具XDebug 大型网站调试工具
Look And Say 序列php实现代码
php利用cookie实现访问次数统计代码
php中将地址生成迅雷快车旋风链接的代码[测试通过]
php curl 登录163邮箱并抓取邮箱好友列表的代码(经测试)
PHPUnit PHP测试框架安装方法
PHP单元测试利器 PHPUNIT深入用法(三)第1/2页
PHP单元测试利器 PHPUNIT深入用法(二)第1/2页
PHP 压缩文件夹的类代码
网页游戏开发入门教程三(简单程序应用)
初学CAKEPHP 基础教程
PHP+MySQL 制作简单的留言本
PHP+XML 制作简单的留言本 图文教程
php 调用远程url的六种方法小结
phpmailer 中文使用说明(简易版)
php侧拉菜单 漂亮,可以向右或者向左展开,支持FF,IE
PHP获取163、gmail、126等邮箱联系人地址【已测试2009.10.10】
PHP 获取MSN好友列表的代码(2009-05-14测试通过)
php Try Catch异常测试
php intval的测试代码发现问题
php adodb连接带密码access数据库实例,测试成功