Jquery使DIV可见/不可见 [英] Jquery for making DIV visible/invisible
问题描述
我打算显示一个树状结构,点击树状结构时我想要显示一个网格.既然要展示原型,就想着用jquery来展示如下
<块引用>Application1(点击)
- 显示带有数据的(类似于网格)
应用程序 2(点击)
- 折叠应用程序 1
Div
(不可见) - 应用程序 2
DIV
(可见)
等等..
有什么可用的例子可以用来模拟这个吗?
解决方案这是一个真实的基本示例:http://jsfiddle.net/YBABG/1/
应用1<div class="childNode">信息</div><div class="parentNode a2">应用程序2<div class="childNode">信息</div>
$(".childNode").hide();$(".parentNode").click(function(){$(".childNode").hide(100);$(this).children().show(100);});
在隐藏中指定持续时间将创建一个简单的动画效果.
I am planning to show a tree structure and on clicking the tree structure I wanted a grid to be displayed. Since I have to show a prototype, I am thinking of using Jquery to show the following
Application1 (Onclick)
- Display a
<DIV>
with data (similar to a grid)
Application 2 (Onclick)
- Collapse Application 1
Div
(invisible) - Application 2
DIV
(visible)
so on..
Is there any example that is available that I can use to simulate this?
解决方案Here is a real basic example: http://jsfiddle.net/YBABG/1/
<div class="parentNode a1">Application 1 <div class="childNode">Information</div> </div> <div class="parentNode a2">Application 2 <div class="childNode">Information</div> </div> $(".childNode").hide(); $(".parentNode").click(function(){ $(".childNode").hide(100); $(this).children().show(100); });
Specifying a duration in hide will create a simple animated effect.
这篇关于Jquery使DIV可见/不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 折叠应用程序 1