嘿伙计们,我在将我的 JQuery SlideToggle 操作指定到特定选项卡(文本框)时遇到问题目前它正在整个菜单中使用整个 SlideToggle 操作。当您将鼠标悬停在一个菜单选项卡上时,我希望在每个菜单选项卡上的分隔符之间有一个绿色滑动框。需要帮忙...
http://jsfiddle.net/jfarr07/yKF65/1/
HTML
<div id="navigation">
<div class="panel"></div>
<ul id="nav">
<li class="nav"><a href="#">HOME</a></li>
<li class="nav"><a href="#">OUR STORY</a></li>
<li class="nav"><a href="#">GALLERY</a></li>
<li class="nav"><a href="#">GIFT REGISTRY</a></li>
</ul>
</div>
CSS
body, html {
padding:0;
margin:0;
background:url(../../Portfolio/images/wood2.png);
}
a:link {
text-decoration:none;
color:#000;
font-family:open-sans, HelveticaNeue, Helvetica Neue Condensed Bold, Helvetica Neue, serif;
}
a:visited {
color:#000;
}
a:hover {
color:#FFF;
}
#navigation {
width:auto;
height:30px;
background:rgba(0, 0, 0, .25);
}
ul#nav {
display:inline;
}
li.nav {
display:inline-block;
margin: 0px 0px 0px 30px;
padding:0px 0px 0px 30px;
position:relative;
}
li~li {
border-left: 1px solid #000000;
}
.panel {
position:absolute;
background:#0F3;
background-size:100%;
height:30px;
display:none;
width:100%;
}
jQuery
<script>
$(document).ready(function() {
$("li.nav").hover(function() {
$("#navigation").find(".panel").stop().slideToggle("fast");
}, function() {
$("#navigation").find(".panel").stop().slideToggle("fast");
});
});
</script>