我做到了,耶...这是最简单的 jquery 解决方案,用 hoverintent 插件做一个基本的 drop div,我的 html 根本不需要改变,我也展示了我的 css ......观察
<script type="text/javascript" charset="utf-8">
//<![CDATA[
$(document).ready(function() {
//add hovering class to li's inside of the unordermened with the id menu
function addMega(){
$(this).addClass("hovering");
}
//remove hovering class to li's inside of the unordermened with the id menu
function removeMega(){
$(this).removeClass("hovering");
}
//configuariton for hoverintent plugin, hoveron time, mouse sensitivity, hoveroff time
var megaConfig = {
interval: 300,
sensitivity: 4,
over: addMega,
timeout: 200,
out: removeMega
};
//make list items with the class megamenu have the hoverinter plugin excuted on them
$("li.megamenu").hoverIntent(megaConfig)
});
//]]>
</script>
CSS
ul#menu
{
display:block;
list-style-type:none;
margin:0;
padding:0;
}
ul# menu li
{
display:inline;
position: relative;
}
ul#menu div {
display: none;
}
ul#menu li.mega div {
position: absolute;
}
ul#menu li.hovering div {
display: block;
}
#aboutdke
{
display:block;
color:#FFF;
text-align:left;
font-family:Verdana, Geneva, sans-serif;
font-size:10px;
background-color:#000;
margin:0;
padding-top:10px;
padding-right:10px;
padding-bottom:10px;
padding-left:10px;
border:0px;
width:910px;
height:280px;
float:left;
position:absolute;
z-index:99999;
top:164px;
left:140px;
}
a.links:link
{
display:block;
width:120px;
height:22px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:none;
text-align:center;
outline:none;
float:left;
}
a.links:visited
{
display:block;
width:120px;
height:22px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:none;
text-align:center;
outline:none;
float:left;
}
/* mouse over link */
a.links:hover
{
display:block;
width:120px;
height:22px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:underline;
text-align:center;
outline:none;
background-color:#000;
float:left;
}
/* selected link */
a.links:active
{
display:block;
width:120px;
height:22px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:underline;
text-align:center;
outline:none;
background-color:#000;
float:left;
}
a.dkeorg:link
{
display:block;
width:120px;
height:23px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:none;
text-align:center;
outline:none;
float:left;
}
a.dkeorg:visited
{
display:block;
width:120px;
height:23px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:none;
text-align:center;
outline:none;
}
/* mouse over link */
a.dkeorg:hover
{
display:block;
width:120px;
height:23px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:underline;
text-align:center;
outline:none;
float:left;
}
/* selected link */
a.dkeorg:active
{
display:block;
width:120px;
height:23px;
padding-top:8px;
padding-left:3px;
padding-bottom:0px;
color:#FFF;
text-decoration:underline;
text-align:center;
outline:none;
float:left;
}