(开始对不起我的英语)!我有一个 jquery 悬停问题。我有一个导航,如果鼠标悬停某个元素(播放器和登录按钮)jquery show() 相应的 div。这工作正常,但是当我将相应的 div 悬停时,div 隐藏但应该保留。
导航元素:
<li class="hover" title="login"><img src="images/nav-log.png" alt="player" border="0" /></li>
<li class="hover" title="player"><img src="images/nav-ply.png" alt="player" border="0" /></li>
jQuery:
var playerstat = 0;
$(".hover").mouseover(function() {
link = $(this);
layer = $("#" + link.attr("title") + "_content");
position = link.position();
link.attr("id","aktiv");
if(link.attr("title") == "player" && playerstat == 0){
link.click(function() {
});
}
layer.css({
top : ($("html, body").scrollTop() + position.top + $(this).height() + 3) + 'px',
left : (position.left - layer.outerWidth() + link.width()) + 'px'
});
layer.show();
layer.mouseover(function() {
alert("over");
link.attr("id","aktiv");
$(this).show();
}).mouseleave(function(){
link.attr("id","");
$(this).hide();
});
}).mouseout(function(){
link.attr("id","");
$("#" + $(this).attr("title") + "_content").hide();
});
玩家:
<div id="player_content" class="theme-gradient theme-shadow">
<span id="track-info" class="theme-fontbggrey"></span>
<span id="player-layer"></span></div>
我希望有人理解我...谢谢你帮助我