0

我有一个包含框架集的索引文件:

<frameset border="1" frameborder="0" framespacing="0" rows="7%,93%">
  <frame src="index_top.htm" scrolling="no" marginwidth="0"
  marginheight="0" noresize name="top" target="_self">
    <frame name="main" src="index_main.html"
    scrolling="auto" marginwidth="0" marginheight="0">
  <noframes>

index_top文件如下所示(仅相关部分):

<table width="100%" border="0" align="left" cellpadding="3" cellspacing="3" class="menyrad">
  <tr valign="middle" align="center">
    <td width="10%" id="homenav"><a href="framsida_test.html" onClick="changeClass(1)">Furniture home</a></td>
    <td width="10%" colspan="6">Currently browsing: <i id="mainlink"><span id="header">Select page</span><div id="linkdiv"><p><a href="coffee.html" id="link1" onClick="changeHeader(2)">Coffee tables</a></p><p>
<a href="side.html" id="link2" onClick="changeHeader(3)">Side tables</a></p><p><a href="stand.html" id="link3" onClick="changeHeader(4)">Stand tables</a></p><p>
<a href="dinner.html" id="link4" onClick="changeHeader(5)">Dinner tables</a></p><p><a href="sp.html" id="link5" onClick="changeHeader(6)">Stools/Pedestals</a></p></div></i></td>
    <td width="4%" id="galleriesnav"><a href="galleries.html" onClick="changeClass(2)">Galleries</a></td>
    <td width="4%" id="pressnav"><a href="press.html" onClick="changeClass(3)">Press</a></td>
    <td width="4%" id="factsnav"><a href="facts.html" onClick="changeClass(4)">Facts</a></td>
    <td width="4%" id="contactnav"><a href="contact.php" onClick="changeClass(5)">Contact</a></td>
    <td width="10%"><a href="http://www.carlson.se" target="_new">About artist Carlson</a></td>
  </tr>    
 </table>

相关的CSS index_top

#linkdiv
{
    position:absolute;
    visibility:hidden;
    left:502px;
    width:100px;
    height:130px;
    background-color:#FFF;
    border-style:solid;
    border-color:black;
    border-width:2px;
    font-style:normal;

}

#header
{
    display:inline-block;
    text-align:center;
    width:100px;
}



#link1, #link2, #link3, #link4, #link5, #link6
{
    color:#000;
    text-decoration:none;
    width:100%;
    display:block;
    outline:0;
}

#link1:hover, #link2:hover, #link3:hover, #link4:hover, #link5:hover, #link6:hover
{
    width:100%;
    color:#FFF;
    font-weight:bold;
}

#mainlink:hover #linkdiv
{
    visibility:visible;
}

Aaaa 和 JavaScript:

function changeClass(Index)
{
    var ids = new Array("null","homenav","galleriesnav","pressnav","factsnav","contactnav");
    var color = new Array("null","#c9a900","#4814a9","#71a28a","#ac27a9","#998f86");
    var i=1;
    var length = ids.length;
    while (i<length)
    {
        document.getElementById(ids[i]).style.backgroundColor = '#FFF';
        document.getElementById(ids[i]).className = "blacklink";
        document.getElementById(ids[Index]).style.backgroundColor =color[Index];
        document.getElementById(ids[Index]).className = "whitelink";
        i++;
    }

}

function changeHeader(HeadIndex)
{
    var headers = new Array("null","Select page","Coffee tables","Side tables","Stand tables","Dinner tables","Stools","Pedestals");
    var colors = new Array("null","#f32837","#0085cf","#00aa86","#c99900","c42695","#617f90");
    document.getElementById("header").innerHTML = headers[HeadIndex];
    if (HeadIndex > 1)
    {
        document.getElementById("header").style.fontWeight = "bold";
        document.getElementById("header").style.color = "#FFF";
        document.getElementById("header").style.backgroundColor = colors[HeadIndex];
        document.getElementById("header").style.fontStyle = "normal";
    }

}

所以,我在这里的问题(对不起大量代码)是,当您尝试将鼠标悬停在“选择页面”文本上时,隐藏div的内容正在显示......但在主框架下。因此,不可能按下链接。如何显示divOVER 主框架以使其可点击?甚至可能吗?

4

1 回答 1

1

在框架外的 index.html 中包含您的显示/隐藏 div。然后使用 css 定位和 z-index 强制它出现在框架上方。

于 2012-11-02T17:57:31.450 回答