已有83人关注
PHP从入门到精通 项目资源库 项目3办公自动化管理系统(OA)二级菜单打开时重叠,求修改正确
发表在PHP答疑区 2017-04-24
是否精华
版块置顶:


怎样修改,才能解决这个问题?





js代码:

//动态菜单

function clickHandler() {

var targetId, srcElement, targetElement;

srcElement = window.event.srcElement;

if (srcElement.className == "Outline") {

targetId = srcElement.id + "details"; 

imgid = srcElement.id + "img";

targetElement = document.all(targetId);

if (targetElement.style.display == "none") {

document[imgid].src = "images/jian.gif";

targetElement.style.display = "";

} else {

document[imgid].src = "images/jia.gif";

targetElement.style.display = "none";

}

}

}

left.php代码部分:

<?php

session_start();

//include "inc/chec.php";

include "conn/conn.php";

include "inc/func.php";

?>

<link href="css/style.css" rel="stylesheet" />

<script src="js/client_js.js"></script>

<script language=JavaScript>

document.onclick = clickHandler;

</script>

<table border="0" cellpadding="0" cellspacing="0" width="203" height="509" background="images/left.jpg">

<tr>

<td width="10">&nbsp;</td>

<td height="20"></td>

</tr>

<tr>

<td>

<td align="center" valign="top">

<?php

$t_result = get_tp($conn);

$num = 0;

while($t_rows = mysql_fetch_row($t_result)){

echo "<div id=div".$num." style='position:relative; background-color:#DEEBEF; width:190; height:25; '>";

echo "<span id=div".$num." class = Outline style='hand:hand;'></span>";

echo "<label id=div".$num." class = Outline style='cursor:hand;'>";

echo "<img src=images/jia.gif id=div".$num."img name=div".$num."img/>".$t_rows[0]."</label>";

//输出二级菜单

$sqlstr = "select * from tb_list where f_type='".$t_rows[0]."'";

$result = mysql_query($sqlstr,$conn);

echo "<div id=div".$num."details style=\"display:None; position:relative; left:35;\">";

while($rows = mysql_fetch_row($result)){

if($rows[4] == "0"){

echo "<img src=images/folder.gif /><U><a href='".$rows[3]."?u_id=".$rows[0]."' target=mainFrame>".$rows[1]."</a></U>";

echo "<br/>";

}else{

$bool = false;

$g_list = split(",",$rows[4]);

for($i=0;$i<count($g_list);$i++){

if($_SESSION[u_group] == $g_list[$i]){

$bool = true;

break;

}

}

if($rows[5] != "1"){

$p_list = split(",",$rows[5]);

for($i=0;$i<count($p_list);$i++){

if($_SESSION[u_name] == $p_list[$i]){

$bool = true;

break;

}

}

}

if($bool){

echo "<img src=images/folder.gif /><U><a href='".$rows[3]."?u_id=".$rows[0]."' target=mainFrame>".$rows[1]."</a></U>";

echo "<br/>";

}

}

}

echo "</div></div>";


$num++;

}

?>

</td>

</tr>

<tr>

<td colspan="2" height="54" background="images/left_top.jpg">&nbsp;</td>

</tr>

</table>



分享到:
精彩评论 2
木木初
学分:482 LV5
TA的每日心情
伤心
2017-09-04 22:27:56
2017-04-24
沙发

打开left.php文件,在外层while语句中将height:25修改为height:auto,在其后面添加padding-top:10px;

php编程新手
学分:43 LV2
2017-04-24
板凳

木木初 发表于2017-04-24 16:46

打开left.php文件,在外层while语句中将height:25修改为height:auto,在其后面添加padding-top:10px;

谢谢帮助

首页上一页 1 下一页尾页 2 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照