会滑出从任何页面边缘的一组固定的菜单。滑出,从左侧和右侧的两个菜单也可以与主体移动到左侧或右侧,分别组合使用,因此被“推”。
有这样的例子,如何触发的开幕和闭幕的菜单和一些例如媒体查询。
图2
style="float:none;" title="3.jpg"/>
图3
style="float:none;" title="4fb69195-1c4e-4c9a-b528-814905b8ed99.jpg"/>
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <!-- body has the class "cbp-spmenu-push" --> < nav class = "cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id = "cbp-spmenu-s1" > < h3 >Menu</ h3 > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > </ nav > < nav class = "cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id = "cbp-spmenu-s2" > < h3 >Menu</ h3 > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > </ nav > < nav class = "cbp-spmenu cbp-spmenu-horizontal cbp-spmenu-top" id = "cbp-spmenu-s3" > < h3 >Menu</ h3 > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > </ nav > < nav class = "cbp-spmenu cbp-spmenu-horizontal cbp-spmenu-bottom" id = "cbp-spmenu-s4" > < h3 >Menu</ h3 > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > < a href = "#" >Celery seakale</ a > < a href = "#" >Dulse daikon</ a > < a href = "#" >Zucchini garlic</ a > < a href = "#" >Catsear azuki bean</ a > < a href = "#" >Dandelion bunya</ a > < a href = "#" >Rutabaga</ a > </ nav > < div class = "container" > < div class = "main" > < section > < h2 >Slide Menus</ h2 > <!-- Class "cbp-spmenu-open" gets applied to menu --> < button id = "showLeft" >Show/Hide Left Slide Menu</ button > < button id = "showRight" >Show/Hide Right Slide Menu</ button > < button id = "showTop" >Show/Hide Top Slide Menu</ button > < button id = "showBottom" >Show/Hide Bottom Slide Menu</ button > </ section > < section class = "buttonset" > < h2 >Push Menus</ h2 > <!-- Class "cbp-spmenu-open" gets applied to menu and "cbp-spmenu-push-toleft" or "cbp-spmenu-push-toright" to the body --> < button id = "showLeftPush" >Show/Hide Left Push Menu</ button > < button id = "showRightPush" >Show/Hide Right Push Menu</ button > </ section > </ div > </ div > |
css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /* General styles for all menus */ .cbp-spmenu { background : #47a3da ; position : fixed ; } .cbp-spmenu h 3 { color : #afdefa ; font-size : 1.9em ; padding : 20px ; margin : 0 ; font-weight : 300 ; background : #0d77b6 ; } .cbp-spmenu a { display : block ; color : #fff ; font-size : 1.1em ; font-weight : 300 ; } .cbp-spmenu a:hover { background : #258ecd ; } .cbp-spmenu a:active { background : #afdefa ; color : #47a3da ; } /* Orientation-dependent styles for the content of the menu */ .cbp-spmenu-vertical { width : 240px ; height : 100% ; top : 0 ; z-index : 1000 ; } .cbp-spmenu-vertical a { border-bottom : 1px solid #258ecd ; padding : 1em ; } .cbp-spmenu-horizontal { width : 100% ; height : 150px ; left : 0 ; z-index : 1000 ; overflow : hidden ; } .cbp-spmenu-horizontal h 3 { height : 100% ; width : 20% ; float : left ; } .cbp-spmenu-horizontal a { float : left ; width : 20% ; padding : 0.8em ; border-left : 1px solid #258ecd ; } /* Vertical menu that slides from the left or right */ .cbp-spmenu- left { left : -240px ; } .cbp-spmenu- right { right : -240px ; } .cbp-spmenu- left .cbp-spmenu-open { left : 0px ; } .cbp-spmenu- right .cbp-spmenu-open { right : 0px ; } /* Horizontal menu that slides from the top or bottom */ .cbp-spmenu- top { top : -150px ; } .cbp-spmenu- bottom { bottom : -150px ; } .cbp-spmenu- top .cbp-spmenu-open { top : 0px ; } .cbp-spmenu- bottom .cbp-spmenu-open { bottom : 0px ; } /* Push classes applied to the body */ .cbp-spmenu-push { overflow-x: hidden ; position : relative ; left : 0 ; } .cbp-spmenu-push-toright { left : 240px ; } .cbp-spmenu-push-toleft { left : -240px ; } /* Transitions */ .cbp-spmenu, .cbp-spmenu-push { -webkit-transition: all 0.3 s ease; -moz-transition: all 0.3 s ease; transition: all 0.3 s ease; } /* Example media queries */ @media screen and ( max-width : 55.1875em ){ .cbp-spmenu-horizontal { font-size : 75% ; height : 110px ; } .cbp-spmenu- top { top : -110px ; } .cbp-spmenu- bottom { bottom : -110px ; } 特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性! 本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担! 如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com
|