jQuery slideToggle在悬停时保持打开状态

我有一个div,我绑定了jQuery悬停事件,以使用slidetoggle激活slideDown:

<div class="Square">
    <div class="RedSquare"></div>
    <div class="GraySquare"></div>
</div>

$("div.RedSquare").hover(
    function() {
        $(this).siblings("div.GraySquare").slidetoggle("fast");
    },function() {
        $(this).siblings("div.GraySquare").slidetoggle("fast");
    }
);

它在它下面切换一个div’.GraySquare’.基本上从灰色框中滑下灰色框.我面临的问题是当鼠标在灰色div上移动时,幻灯片会向上移动.我希望它悬停在红色或灰色方块上时保持不动.

任何帮助表示赞赏.

解决方法

更改它,以便悬停在包含“Square”div上处于活动状态:

$("div.Square").hover(
    function() {
        $(this).find("div.GraySquare").slidetoggle("fast");
    },function() {
        $(this).find("div.GraySquare").slidetoggle("fast");
    }
);

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...