jquery.foldit.js是一款下拉折叠菜单插件

jquery.foldit.js是一款下拉折叠菜单插件

jquery.foldit.min.js是一款下拉折叠菜单插件。菜单点击后折叠打开,有立体效果,兼容手机端。

使用方式:

第一步引入jquery

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.1.11.min.js"></script>

第二步引入foldit插件

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/foldit.css">

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.foldit.min.js"></script>

第三步准备dom及js配置参数

 <ul class="folditmenu">
                <li>
                    <a href="#" class="icon icon-heart"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-comment"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-edit"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-send"></a>
                </li>
                <li class="actionItem">
                    <a href="#" class="icon icon-menu"></a>
                </li>
 </ul>

 $( document ).ready(function() { 
                $( ".folditmenu" ).folditmenu({perspective:200});     
            });  

完整示例代码:

<!DOCTYPE html>
<html>

<head>

    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/foldit.css">
    <style type="text/css">
        body {
	background:#666;
	padding:0;
	margin:0
}
.phone {
	width:304px;
	height:544px;
	padding:108px 27px 110px 27px;
	margin:30px auto;
	background:url(//repo.bfw.wiki/bfwrepo/images/menu/phone.png) no-repeat
}
.app {
	background:#0d3d69 url(//repo.bfw.wiki/bfwrepo/images/menu/bg.jpg) no-repeat 50% 0;
	height:544px;
	position:relative;
}
.folditmenu {
	padding:0;
	margin:0 0 0 -30px;
	list-style:none;
	width:60px;
	position:absolute;
	top:46px;
	left:50%;
}
.folditmenu li {
	height:60px;
	background:#fff;
	border-top:1px solid #ccc;
	text-align:center;
	z-index:1
}
.actionItem {
	border-radius:0   0 10px 10px;
	box-shadow:0 9px 9px -2px #ccc inset;
}
.menuIsOpen  .actionItem {
	box-shadow:none
}
.menuIsOpen li:first-child {
	box-shadow:0 9px 9px -2px #ccc inset;
}
[class^="icon-"],[class*=" icon-"] {
	display:inline-block;
	width:34px;
	height:34px;
	margin-top:15px;
	line-height:14px;
	vertical-align:text-top;
	background-image:url("//repo.bfw.wiki/bfwrepo/images/menu/icon.png");
	background-position:14px 14px;
	background-repeat:no-repeat;
}
  .icon-heart {
	background-position:0 2px;
}
.icon-comment {
	background-position:0px -39px;
}
.icon-edit {
	background-position:-4px -91px;
}
.icon-send {
	background-position:-2px -147px;
}
.icon-menu {
	background-position:1px -196px;
}
@media (max-width:640px) {
	.phone {
	width:auto;
	height:544px;
	padding:0;
	margin:0px auto;
	background:none
}
}
    </style>
</head>

<body>
    <div class="phone">
        <div class="app">
            <ul class="folditmenu">
                <li>
                    <a href="#" class="icon icon-heart"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-comment"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-edit"></a>
                </li>
                <li>
                    <a href="#" class="icon icon-send"></a>
                </li>
                <li class="actionItem">
                    <a href="#" class="icon icon-menu"></a>
                </li>
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.1.11.min.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.foldit.min.js"></script>
    <script>
        (function($){         
            $( document ).ready(function() { 
                $( ".folditmenu" ).folditmenu({perspective:200});     
            });  
        })(jQuery);
    </script>
</body>

</html>


立即下载jquery.foldit.min.js查看所有js插件

网友评论0

程序员在线工具箱