jQuery:隐藏“活动类”当鼠标未悬停时
我有以下 jQuery 插件: http://jqueryfordesigners.com/slide-out-and -drawer-effect/
现在的问题是:当鼠标不在元素上方时,我想关闭活动的“抽屉”。 jQuery 设置为保持活动元素打开,直到鼠标悬停应用于另一个抽屉元素。当鼠标悬停在任何一个抽屉上时,如何关闭所有抽屉?
初始化代码:
$(function () {
$('UL.drawers').accordion({
// the drawer handle
header: 'H2.drawer-handle',
// our selected class
selectedClass: 'open',
// match the Apple slide out effect
event: 'mouseover'
});
});
此外,当我将“open”类应用于抽屉元素 css (.drawer-handle.open {}
) 时,活动抽屉手柄不会改变颜色(动画),因为它应该。这是为什么?我在 Joomla 1.7 中使用 PHP
谢谢!
I have the following jQuery plugin: http://jqueryfordesigners.com/slide-out-and-drawer-effect/
Now the problem is: I would like to close the active 'drawer' when the mouse is not over the element. The jQuery is set to keep the active one open until the mouseover is applied to another drawer element. How do I close all the drawers when not hovering over any of them?
Initialization code:
$(function () {
$('UL.drawers').accordion({
// the drawer handle
header: 'H2.drawer-handle',
// our selected class
selectedClass: 'open',
// match the Apple slide out effect
event: 'mouseover'
});
});
Also, when I apply the 'open' class to the drawer element css (.drawer-handle.open {}
), the active drawer-handle does not change color(animate) as it should. Why is that? I'm using PHP within Joomla 1.7
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是为您提供的部分解决方案:
我说部分是因为此设置的行为并不像我想象的那么顺利,但如果结果接近您正在寻找的结果,那么它应该会让您朝着正确的方向开始。
您可以使用以下 jsFiddle 来查看它的运行情况: http://jsfiddle.net/gKNGh/1/
Here is a partial solution for you:
I say partial because the behavior of this setup is not quite as smooth as I think it should be, but if the result is close to what you are looking for it should get you started in the right direction.
You can see it in action with this jsFiddle: http://jsfiddle.net/gKNGh/1/