jquery中手风琴效果实用源代码
2012-03-28 17:38
555 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>手风琴效果</title>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
$("#accordion").accordion({
header: "h3", //头信息。页面中div是什么这就必须是什么
event:"mouseover", //面板展开的效果事件,默认是click
active:1, //默认展开的面板,从0开始,默认值为0
animated:"bounceslide", //面板展开的动画效果
autoHeight:true, //面板的高度是否是自动增高的,默认为true
fillSpace:true, //填充到父元素
icons:{
//图标的设置 header默认时的效果 headerSelected代表是面板激活状态的效果图标
header:"ui-icon-carat-2-e-w",
headerSelected:"ui-icon-carat-2-n-s"
}
}).sortable({
axis:"y", //表示只能在y轴上托拽排序 x轴 x,y默认x,y
handle:"h3", //只能拖拽h3
/* stop:function(event,ui){
//stop事件 本身是一个匿名函数 event是浏览器自带的事件处理对象 ui操作控件对象
//alert("你要停止吗?");
ui.item.children("h3").triggerHandler("focusout");
}*/
});
$("#accordion").bind("sortstop",function(event,ui){
alert("hdsadhhds");
});
});
</script>
</head>
<body>
<div id="accordion" style="width:600px; height:400px; border:#0F0 solid 1px;">
<div>
<h3><a href="#">First</a></h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
</div>
<div>
<h3><a href="#">Second</a></h3>
<div>Phasellus mattis tincidunt nibh.</div>
</div>
<div>
<h3><a href="#">Third</a></h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>手风琴效果</title>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
$("#accordion").accordion({
header: "h3", //头信息。页面中div是什么这就必须是什么
event:"mouseover", //面板展开的效果事件,默认是click
active:1, //默认展开的面板,从0开始,默认值为0
animated:"bounceslide", //面板展开的动画效果
autoHeight:true, //面板的高度是否是自动增高的,默认为true
fillSpace:true, //填充到父元素
icons:{
//图标的设置 header默认时的效果 headerSelected代表是面板激活状态的效果图标
header:"ui-icon-carat-2-e-w",
headerSelected:"ui-icon-carat-2-n-s"
}
}).sortable({
axis:"y", //表示只能在y轴上托拽排序 x轴 x,y默认x,y
handle:"h3", //只能拖拽h3
/* stop:function(event,ui){
//stop事件 本身是一个匿名函数 event是浏览器自带的事件处理对象 ui操作控件对象
//alert("你要停止吗?");
ui.item.children("h3").triggerHandler("focusout");
}*/
});
$("#accordion").bind("sortstop",function(event,ui){
alert("hdsadhhds");
});
});
</script>
</head>
<body>
<div id="accordion" style="width:600px; height:400px; border:#0F0 solid 1px;">
<div>
<h3><a href="#">First</a></h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
</div>
<div>
<h3><a href="#">Second</a></h3>
<div>Phasellus mattis tincidunt nibh.</div>
</div>
<div>
<h3><a href="#">Third</a></h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
</div>
</body>
</html>
相关文章推荐
- jquery实用代码 - 多标签切换显示内容效果
- 超简单的 jquery 版 手风琴滑块效果
- 基于jquery的手风琴图片展示效果实现方法
- jquery实现下拉菜单的手风琴效果
- jquery实现手风琴效果
- 通过jquery来实现文本框和下拉框动态添加效果,能根据自己的需求来自定义最多允许添加数量,实用的jquery动态添加文本框特效
- bootstrap中jquery插件——collapse折叠效果-手风琴效果
- 30个创意出色的非常实用的jquery框架插件-(视觉大背景,瀑布流效果)
- jQuery做出手风琴效果
- jQuery实现非常实用漂亮的select下拉菜单选择效果
- 基于jQuery实现多层次的手风琴效果附源码
- jquery手风琴效果插件
- jquery插件实现手风琴效果!
- jQuery 超实用的图片列表布局切换效果
- jQuery制作效果超棒的手风琴折叠菜单
- jquery实现手风琴效果
- Jquery手风琴效果(无插件)
- jQuery插件实例四:手风琴效果[无动画版]
- 带动画效果的jQuery手风琴