描述:这款手风琴效果适用于折叠的菜单,方便使用!用这款插件制作极其方便,只需要定义很少的参数,便可制作出纵向手风琴效果!
图片展示:
兼容浏览器: IE6+/Firefox/Google Chrome
官方链接: 暂无
JS下载: http://ijquery.360sites.cn/js/jquery.accordion.js
预览: http://ijquery.360sites.cn/demo/accordion
打包下载: http://ijquery.360sites.cn/demo/accordion/accordion.zip
参数说明:
JS引用代码:特别注意,这里需要引入demensions.js这个js
- <script type="text/javascript" src="http://ijquery.360sites.cn/js/jquery-1.7.2.min.js"></script>
- <script type="text/javascript" src="http://ijquery.360sites.cn/js/jquery.dimensions.js"></script>
- <script type="text/javascript" src="http://ijquery.360sites.cn/js/jquery.accordion.js"></script>
- <script type="text/javascript">
- $().ready(function(){
- $('.basic').accordion({
- event: 'mouseover'
- });
- });
- </script>
复制代码
HTML代码:
- <div class="basic" style="margin:0 auto;margin-top:50px;" >
- <a>菜单一:</a>
- <div>
- <p>
- You've seen it coming!
-
- Buy now and get nothing for free!
-
- Well, at least no free beer. Perhaps a bear,
-
- if you can afford it.
- </p>
- </div>
- <a>菜单二:</a>
- <div>
- <p>
- your bear, you have to admit it!
-
- No, we aren't selling bears.
- </p>
- </div>
- <a>菜单三:</a>
- <div>
- <p>
- get two for three beer.
- </p>
- <p>
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- And now, for something completely different.
-
- Period.
- </p>
- </div>
- </div>
复制代码
CSS代码:
这里需要两张图片,就是鼠标经过时的两张图片,在这里就不上传了,自己随便制作两个高29px的图片即可!
- <link rel="stylesheet" href="demo.css" />
复制代码
即:
- .basic {
- width: 260px;
- font-family: verdana;
- border: 1px solid black;
- }
- .basic div {
- background-color: #eee;
- }
-
- .basic p {
- margin-bottom : 10px;
- border: none;
- text-decoration: none;
- font-weight: bold;
- font-size: 10px;
- margin: 0px;
- padding: 10px;
- }
- .basic a {
- cursor:pointer;
- display:block;
- padding:5px;
- margin-top: 0;
- text-decoration: none;
- font-weight: bold;
- font-size: 12px;
- color: black;
- background-color: #00a0c6;
- border-top: 1px solid #FFFFFF;
- border-bottom: 1px solid #999;
-
- background-image: url("AccordionTab0.gif");
- }
- .basic a:hover {
- background-color: white;
- background-image: url("AccordionTab2.gif");
- }
- .basic a.selected {
- color: black;
- background-color: #80cfe2;
- background-image: url("AccordionTab2.gif");
- }
复制代码
[转] http://ijquery.360sites.cn/forum.php?mod=viewthread&tid=30