日期:2014-05-18 浏览次数:20482 次
function showcontent() { if ($("#notify_content").is(':visible')) $("#notify_content").hide(); else $("#notify_content").show(); }
------解决方案--------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../themes/icon.css">
<script type="text/javascript" src="../jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script type="text/javascript">
function setsize(){
$('#cc').width(700).height(350);
$('#aa').trigger('_resize');
}
function select(){
$('#aa').accordion('select','Title1');
}
</script>
</head>
<body>
<h1>Accordion</h1>
<div style="margin-bottom: 10px;">
<a href="#" onclick="setsize()">setsize</a>
<a href="#" onclick="select()">select</a>
</div>
<div id="cc" style="overflow:auto;width:600px;height:300px;padding:10px;border:1px solid #ccc;">
<div id="aa" class="easyui-accordion" fit="true" style="width:300px;height:200px;">
<div title="Title1" icon="icon-ok" style="overflow:auto;padding:10px;">
<h3 style="color:#0099FF;">Accordion for jQuery</h3>
<p>内容一.</p>
</div>
<div title="Title2" icon="icon-reload" selected="true" style="padding:10px;">
内容二
</div>
<div title="Title3">
内容三 </div>
</div>
</div>
</body>
</html>
滑动折叠效果
------解决方案--------------------
//jquery slideTogge(speed,function(){})//第一个参数速度("slow,fast,normal")第二个回调函数 <head> <title>无标题页</title> <script type="text/ecmascript" src="js/jquery-1.3.2.min.js"></script> <script> function show(id){ $("#"+id).slideToggle("slow",function(){ if($("#aclick").html()=="显示") $("#aclick").html("隐藏"); else $("#aclick").html("显示") }) } </script> </head> <body> <div> <a id="aclick" onclick="show('content')">隐藏</a> <div id="content" style="background:red;width:100px;height:100px"></div> </div> </body>