JS控制关闭与显示层的问题

来源:百度知道 编辑:UC知道 时间:2024/05/31 10:33:22
这个程序可以关闭层A的同时显示层B,但无法在关闭层B的同时再显示层A.
请写出可以再显示层A的代码,非常感谢.

原代码如下:
<SCRIPT language=JavaScript1.2>
<!--
var x =0
var y=0
drag = 0
move = 0
window.document.onmousemove = mouseMove
window.document.onmousedown = mouseDown
window.document.onmouseup = mouseUp
window.document.ondragstart = mouseStop
function mouseUp() {
move = 0
}
function mouseDown() {
if (drag) {
clickleft = window.event.x - parseInt(dragObj.style.left)
clicktop = window.event.y - parseInt(dragObj.style.top)
dragObj.style.zIndex += 1
move = 1
}
}
function mouseMove() {
if (move) {
dragObj.style.left = window.event.x - clickleft
dragObj.style.top = window.event.y - clicktop
}
}
function mouseStop() {
window.event.returnValue = false
}
function Show(divid) {
divid.filters.revealTrans.apply();
divid.style.visibility = "visible";

A->id=menu1
B->id=READ

function Hide(divid) {

//应用特效显示
divid.filters.revealTrans.apply();
divid.style.visibility = "hidden"; //隐藏
divid.filters.revealTrans.play();

//ggetElementById("menu1") 获取id为menu1的对象。
//display属性改为显示
document.getElementById("menu1").style.display="";
document.getElementById("menu1").focus();
}
function hideMenu(divid){
document.getElementById("menu1").style.display="none";
}

改一下hideMenu函数就可以了。

function hideMenu(divid){
document.getElementById("menu1").style.display="none";
document.getElementById("READ").style.display="";
}

<SCRIPT language=JavaScript1.2>
<!--
var x =0
var y=0
drag = 0
move = 0
window.document.onmousemove = mouseMove
window.document.onmou