100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > html优美界面左侧下拉 一组时尚的侧边栏菜单和下拉列表UI设计

html优美界面左侧下拉 一组时尚的侧边栏菜单和下拉列表UI设计

时间:2019-09-15 02:34:36

相关推荐

html优美界面左侧下拉 一组时尚的侧边栏菜单和下拉列表UI设计

这是一款非常时尚的可伸展的侧边栏菜单和select下拉列表以及手风琴式垂直下拉列表UI设计效果。它们通过简单的CSS样式设置,以及和jQuery,jqueryUI的配合,制作出非常时尚的web组件UI设计效果。

制作方法

HTML结构

侧边栏的HTML结构使用在

中嵌套无序列表的HTML结构。DASHBOARDUSERSPRIORITYCOLLECTIONSARCHIVEDDELETEDTRENDSTASKSFILTERSSTATSSETTINGS

select下拉列表的HTML结构如下:

Select a branchGroup headerFilmore DistrictMission DistrictNorthshare BeachSome other branch

手风琴垂直下拉列表的HTML结构如下:

GROUP 1

Item 1

...

GROUP 2

Item 1

...

GROUP 3

Item 1

...

CSS样式

这3个UI组件的CSS样式都非常简单。其中侧边栏菜单的样式如下:它使用绝对定位来设置各个元素的位置,并给各个元素设置适当的大小,颜色和padding值。

#sidebar-menu{

background:#229bdc;

overflow:hidden;

border-radius:5px;

position:absolute;

top: 60px;

left: 0;

height:62 0px;

width:55px;

color:#abe2ff;

font-size:12px;

font-weight:900;

-webkit-transition: all 200ms ease-out;

-moz-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

-ms-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

-o-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

}

#sidebar-menu.animate{

width:210px;

-webkit-transition: all 200ms ease-out;

-moz-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

-ms-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

-o-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);

}

#toggleMenu{

background:#1888c4;

height:37px;

}

#toggleMenu .list{

position:absolute;

top: 12px;

cursor:pointer;

right: 8px;;

height:30px;

width:30px;

height:30px;

background:url("../img/toggle-list.png") 0 0 no-repeat;

}

#toggleMenu .thumbs{

position:absolute;

display:none;

top: 9px;

cursor:pointer;

right: 3px;

height:30px;

width:30px;

height:30px;

background:url("../img/toggle-thumbs.png") 0 0 no-repeat;

}

#sidebar-menu li{

background:url("../img/sidemenu-sprite.png") 0 0 no-repeat;

padding: 15px 0 15px 54px;

margin: 1px 4px 1px 4px;

list-style: none;

}

最后为菜单列表中的每个元素设置一个背景图像作为小图标。

JAVASCRIPT

在垂直手风琴下拉列表效果中,每一个列表项都是可以用鼠标进行拖动排序的。这是通过jqueryUI的sortable()方法来实现的。

$('.sortable').sortable({ placeholder: 'ui-sortable-placeholder' }).find('li').append('');

其它的操作都是在点击相应元素的时候使用toggleClass()来切换相应的class,以及显示和隐藏相应的元素。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。