Jquery Superfish菜单-如何向上滑动?
这是 superfish 菜单插件的 jquery 代码(经过我的一些修改)。我希望添加一个效果(通过 superfish 或偶然),使子菜单在鼠标移开时向上滑动(就像当您将鼠标悬停在菜单顶部时它们向下滑动一样)。
jQuery("ul.sf-menu").supersubs({
minWidth: 12, // minimum width of sub-menus in em units
maxWidth: 27, // maximum width of sub-menus in em units
extraWidth: 1 // extra width can ensure lines don't sometimes turn over
// due to slight rounding differences and font-family
}).superfish({
delay: 700, // delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'fast', // faster animation speed
autoArrows: true, // disable generation of arrow mark-up
dropShadows: false // disable drop shadows
});
This is the jquery code for superfish menu plugin (after some revisions of mine). I'm looking to add an effect (either through superfish or adventitiously) that would cause the submenus to slide up on mouseout (just as they slide down when you hover a menu-top).
jQuery("ul.sf-menu").supersubs({
minWidth: 12, // minimum width of sub-menus in em units
maxWidth: 27, // maximum width of sub-menus in em units
extraWidth: 1 // extra width can ensure lines don't sometimes turn over
// due to slight rounding differences and font-family
}).superfish({
delay: 700, // delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'fast', // faster animation speed
autoArrows: true, // disable generation of arrow mark-up
dropShadows: false // disable drop shadows
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
但是,您可以通过破解代码来使其工作。我会提交补丁,但代码开发不是公开托管的。
However, you can make it work by hacking the code. I would submit a patch but the code development isn't hosted publicly.
实现隐藏 superfish 任务的正确方法与显示相同:
Correct way to achieve task of hiding superfish same as showing:
目前你不能。直接从代码来看:
您可以看到 show 函数调用 animate(),而 hide 函数只调用 hide()。
You can't, currently. Straight from the code:
You can see that the show function calls animate(), whereas the hide function simply calls hide().
我不确定旧版本的 superfish 但现在很容易完成(向下滑动和向上滑动) - 就像这样
I'm not sure about the older versions of superfish but this is now easily accomplished (slidedown, and slideup) - like so