你需要的是一個鏈接和麪板。 鏈接上的點擊處理程序向面板添加「活動」或「顯示」類。
面板初始化的寬度和高度爲0,需要將過渡應用到面板。 「顯示」或「主動」類的CSS使用旋轉進行變換。
HTML:
<div class="invoke">Invoke</div>
<div class="panel">
Yes this is the panel
</div>
的Javascript:
$('.invoke').click(function(){
$(".panel").addClass("show");
});
CSS:
.panel{
overflow: hidden;
width: 0;
height: 0;
margin: 100px;
background-color: #ff0000;
/* Firefox */
-moz-transition: all 1s ease;
/* WebKit */
-webkit-transition: all 1s ease;
/* Opera */
-o-transition: all 1s ease;
/* Standard */
transition: all 1s ease;
}
.panel.show{
width: 500px;
height: 500px;
/* Firefox */
-moz-transform: rotate(360deg);
/* WebKit */
-webkit-transform: rotate(360deg) ;
/* Opera */
-o-transform: rotate(360deg) ;
/* Standard */
transform: rotate(360deg) ;
}
見我的小提琴
https://jsfiddle.net/cncpv83a/
您希望效果與kartell類似還是需要任何自定義? –
我的客戶幾乎要求我重製當您點擊「FollowUS」和「Search」時打開的面板。在這些面板中,我還會再現相同的搜索表單或社交鏈接列表。 :-) –