jquery实现手风琴效果实例代码
代码如下:
//jquery实现手风琴效果
<!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" language="javascript" src="jquery-1.7.1.min.js">
</script>
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.18.custom.min.js">
</script>
<link rel="stylesheet" href="ui-lightness/jquery-ui-1.8.18.custom.css"/>
<script type="text/javascript" language="javascript">
$(function(){
$("#accordion").accordion(
{
header: "h3",
event:"mouver",
icons:{
header:"ui-icon-carat-2-e-w"
},
}
).sortable({
axis:"y"//拖动效果 上下拖动 默认为左右拖动
});
})
</script>
</head>
<body>
<p id="accordion" style="width:600px; height:600px; border:1px #f00 solid">
<p>
<h3><a href="#">first</a></h3>
<p>lorem ipsum dolor sit amet. lorem ipsum dolor sit amet. lorem ipsum dolor sit amet.</p>
</p>
<p>
<h3><a href="#">second</a></h3>
<p>phasellus mattis tincidunt nibh.</p>
</p>
<p>
<h3><a href="#">third</a></h3>
<p>悠悠</p>
</p>
</p>
</body>
</html>
下一篇: jquery三个关闭弹出层的小示例