javascript 使用 jquery 显示和隐藏叠加层

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12602065/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 16:38:09  来源:igfitidea点击:

Show and Hide overlay using jquery

javascriptjqueryjquery-animate

提问by Shouvik

I am using JQuery for showing and hiding my overlay and it works just great. Now I also wanted to add some animations, hence I went ahead and check out the jq docs and got some nifty animations which can be applied to the show and hide functions directly.

我正在使用 JQuery 来显示和隐藏我的叠加层,而且效果很好。现在我还想添加一些动画,因此我继续查看 jq 文档并获得了一些可以直接应用于显示和隐藏功能的漂亮动画。

What though I am looking for is on clicking, the overlay should appear to come up from the from the div which I clicked on, and on closing the overlay, it should hide by minimizing into the div which was used to open it.

虽然我正在寻找的是点击时,覆盖应该出现在我点击的 div 中,并且在关闭覆盖时,它应该通过最小化到用于打开它的 div 来隐藏。

Thanks

谢谢

Fiddle URL if you can show it here

如果您可以在此处显示 Fiddle URL

回答by techfoobar

Check this fiddle: http://jsfiddle.net/HfKTA/1/- Guess this is what you are looking for.

检查这个小提琴:http: //jsfiddle.net/HfKTA/1/- 猜猜这就是你要找的。

Updated fiddle with multiple triggers: http://jsfiddle.net/HfKTA/2/

使用多个触发器更新小提琴:http: //jsfiddle.net/HfKTA/2/