admin管理员组文章数量:1334916
I'm trying to make SlideDown or an alternative of that effect to a nav
that is bu default visibilty:hidden
and what i'm doing now is like this:
$(this).find('nav.Menu').css('visibility','visible')
It's working just fine, but i have more submenus and i want an effect when hovering between the main menu to slidedown and up submenus. is this possible without display:none/block
?
JSFIDDLE
I'm trying to make SlideDown or an alternative of that effect to a nav
that is bu default visibilty:hidden
and what i'm doing now is like this:
$(this).find('nav.Menu').css('visibility','visible')
It's working just fine, but i have more submenus and i want an effect when hovering between the main menu to slidedown and up submenus. is this possible without display:none/block
?
JSFIDDLE
Share Improve this question edited Jan 29, 2015 at 15:11 Abude asked Jan 29, 2015 at 15:03 AbudeAbude 2,1628 gold badges36 silver badges60 bronze badges 9- Can you post a JSFiddle? – Ionică Bizău Commented Jan 29, 2015 at 15:06
- what happened when you tried it? – atmd Commented Jan 29, 2015 at 15:06
-
@atmd what do you mean? i've tried only making it visible and hidden by
.css
in jQuery – Abude Commented Jan 29, 2015 at 15:07 - Also please post some html – Jamie Hutber Commented Jan 29, 2015 at 15:10
-
1
@JDB, you are absolutely right, but my nav that is hidden has a sub nav that is a sidebar which should be visible, so if i hide by
display
the first nav then i couldn't show the child nav, that's why i'm usingvisibility
– Abude Commented Jan 29, 2015 at 15:12
2 Answers
Reset to default 8Since your element has visibility: hidden
make it visible
, then hide()
it and call the slideDown()
function:
$('#error').css('visibility','visible').hide().slideDown();
JSFDIDLE
The hover handlers can be:
$("<selector>").hover(function () {
$('#error').css('visibility','visible').hide().stop().slideDown();
}, function () {
$('#error').stop().slideUp();
});
You can try positioning your submenu so it is behind its parent, toggle the visibility, and slide it out from behind the parent. You can reverse the process (slide behind, then toggle visibility) when closing the submenu.
本文标签: javascriptIs it possible to animate slideDown on visibility hidden elementStack Overflow
版权声明:本文标题:javascript - Is it possible to animate slideDown on visibility hidden element? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742372550a2462519.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论