繁体   English   中英

鼠标悬停,css过渡和下拉菜单出现问题

[英]Mouse hoverOut, css transition and dropdown menu trouble

我的菜单具有文本过渡样式,并且当我将鼠标悬停在菜单上并悬停时,下拉菜单消失了,但是下拉列表中的文本消失后却有延迟,这就像在完成后必须完成文本过渡样式一样文本将消失。

嗯,我该怎么办? :)

<head>
<style type="text/css">
body{font-family:HelveticaLTStd-Light;}
table{font-size:80%}
a{color:#f0f0f0;text-decoration:none;
-o-transition:.5s;
  -ms-transition:.5s;
  -moz-transition:.5s;
  -webkit-transition:.5s;
  transition:.5s;
}
a:hover{color:#006600;}
font-family:HelveticaLTStd-Light;
td.menu{background:#DEB887}
table.menu
{
font-size:100%;
color:#f0f0f0;
position:absolute;
visibility:hidden;
background:#558800;
opacity:0.9;
}
body {
background:url(wall.jpg) no-repeat fixed center;
}
table
{
border-collapse:collapse;
}
table, td, th
{
position:relative;
}
</style>
<script type="text/javascript">
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden";
}
</script>
</head>

<body>
<div id="header">
<br>
<br><table border="0" align="center">
<tr>
    <th align="left" width="430"><font color="cccccc" face="HelveticaLTStd-Light" size="15">C-Ann Trading</font><br>
    <font color="#f0f0f0" size="5">and Computer Services    </font> </th>
    <th width="120" style="border-right:1px solid #000000;border-color:#cccccc"><br><font size="3"><a href="index.html">Home</a></font></th>
    <th width="120" style="border-right:1px solid #000000;border-color:#cccccc"><br><font size="3"><a href="about.htm">About Us</a></font></th>
    <th width="120" onmouseover="showmenu('products')" onmouseout="hidemenu('products')" style="border-right:1px solid #000000;border-color:#cccccc"><br><font size="3" color="#f0f0f0">Products</font>
        <table border="1" class="menu" id="products" width="150">
        <tr><th align="left" class="menu"><a href="notebook.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspNotebooks</a></tr></th>
        <tr><th align="left" class="menu"><a href="monitor.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspMonitors</a></tr></th>
        <tr><th align="left" class="menu"><a href="component.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspComponents</a></tr></th>
        <tr><th align="left" class="menu"><a href="software.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspSoftwares</a></tr></th>
        <tr><th align="left" class="menu"><a href="peripheral.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspPeripherals</a></tr></th>
        <tr><th align="left" class="menu"><a href="network.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspNetworking</a></tr></th>
        <tr><th align="left" class="menu"><a href="storage.htm">&nbsp&nbsp&nbsp&nbsp&nbsp&nbspStorage Devices</a></tr></th>

我认为您的问题来自此

a{color:#f0f0f0;text-decoration:none;
-o-transition:.5s;
  -ms-transition:.5s;
  -moz-transition:.5s;
  -webkit-transition:.5s;
  transition:.5s;
}

删除标签上的过渡

或将其减少到.2s,这应该像预览一样

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM