在解决这个问题时遇到一些麻烦,任何帮助都会很棒,提前谢谢你
我有一个看起来像这样的菜单
HTML
<li class="menuItem"><a href="#" class="drop" onclick="doWork();">Phones</a>
<div class="flyout">
<div class="col_1">
<a href="#"><h3>Phones</h3></a>
<ul>
<li><a href="https://www.google.com/" target="_top">Nokie</a></li>
<li><a href="https://www.google.com/" target="_blank">Iphone</a></li>
<
</ul>
</div>
</li>
有 2 个 CSS
.menuItem:hover {
border: 1px solid #777777;
/* Background color and gradients */
background: #fafafa; /* Old browsers */
background: -moz-linear-gradient(top, #fafafa 0%, #fcfcfc 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(70%,#fcfcfc), color-stop(100%)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fafafa 0%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fafafa 0%,#fcfcfc 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fafafa 0%,#fcfcfc 100%); /* IE10+ */
background: linear-gradient(to bottom, #fafafa 0%,#fcfcfc 100%); /* W3C */
/* Rounded corners */
-moz-border-radius: 5px 5px 0px 0px;
-webkit-border-radius: 5px 5px 0px 0px;
border-radius: 5px 5px 0px 0px;
}
.menuItem:hover .flyout
{
display:block;
top:auto;
left:0px;
}
您将如何在 onclick 函数上调用这两个类?