문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
wiki:hotwo:how_to_-_off-canvas_menu [2021/04/12 09:00] emblim98 |
— (현재) | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| - | ======HOW TO - Off-Canvas Menu====== | ||
| - | <WRAP left notice 80%> | ||
| - | * description : How TO - Off-Canvas Menu | ||
| - | * author | ||
| - | * email : shlim@repia.com | ||
| - | * lastupdate | ||
| - | </ | ||
| - | <WRAP clear></ | ||
| - | \\ | ||
| - | ====Ref==== | ||
| - | [[https:// | ||
| - | =====Create an Off-Canvas Menu===== | ||
| - | ====예제==== | ||
| - | Step 1) Add %%HTML%% | ||
| - | <code html> | ||
| - | <div id=" | ||
| - | <a href=" | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | </ | ||
| - | <div id=" | ||
| - | < | ||
| - | < | ||
| - | <span style=" | ||
| - | </ | ||
| - | </ | ||
| - | ====예제==== | ||
| - | Step 2) Add %%CSS%%\\ | ||
| - | <code css> | ||
| - | < | ||
| - | body {font-family: | ||
| - | /* The side navigation menu */ | ||
| - | .sidenav { | ||
| - | height: 100%; /* 100% Full-height */ | ||
| - | width: 0; /* 0 width - change this with JavaScript */ | ||
| - | position: fixed; | ||
| - | z-index: 1; /* Stay on top */ | ||
| - | top: 0; | ||
| - | left: 0; | ||
| - | background-color: | ||
| - | overflow-x: hidden; | ||
| - | transition: 0.5s; /* Place content 60px from the top */ | ||
| - | padding-top: | ||
| - | } | ||
| - | /* The navigation menu links */ | ||
| - | .sidenav a { | ||
| - | padding: 8px 8px 8px 32px; | ||
| - | text-decoration: | ||
| - | font-size: 25px; | ||
| - | color: #818181; | ||
| - | display: block; | ||
| - | transition: 0.3s; | ||
| - | } | ||
| - | /* When you mouse over the navigation links, change their color */ | ||
| - | .sidenav a:hover {color: #f1f1f1;} | ||
| - | /* Position and style the close button (top right corner) */ | ||
| - | .sidenav .closebtn { | ||
| - | position: absolute; | ||
| - | top: 0; | ||
| - | right: 25px; | ||
| - | font-size: 36px; | ||
| - | margin-left: | ||
| - | } | ||
| - | /* Style page content - use this if you want to push the page content | ||
| - | to the right when you open the side navigation */ | ||
| - | #main {transition: | ||
| - | /* On smaller screens, where height is less than 450px, | ||
| - | change the style of the sidenav (less padding and a smaller font sixe) */ | ||
| - | @media screen and (max-height: | ||
| - | .sidenav {padding-top: | ||
| - | .sidenav a {font-size: 18px;} | ||
| - | } | ||
| - | </ | ||
| - | </ | ||
| - | ====예제==== | ||
| - | StEP 3) Add %%JavaScript%%\\ | ||
| - | Off-Canvas Menu\\ | ||
| - | <code javascript> | ||
| - | < | ||
| - | /* Set the width of the side navagation to 250px and the left margin of the page content to 250px */ | ||
| - | function openNav() { | ||
| - | document.getElementById(" | ||
| - | document.getElementById(" | ||
| - | } | ||
| - | /* Set the width of the side navagation to 0 and the left margin of the page content to 0 */ | ||
| - | function closeNav() { | ||
| - | document.getElementById(" | ||
| - | document.getElementById(" | ||
| - | } | ||
| - | < | ||
| - | </ | ||
| - | \\ | ||
| - | 아래 예제는 사이드 네비게이션을 슬라이드하고, | ||
| - | 바디 요소에 40% 불투명도(opacity)의 검정 배경색을 추가하여, | ||
| - | ====Off-Canvas Menu w/ opacty==== | ||
| - | <code css> | ||
| - | < | ||
| - | < | ||
| - | |||
| - | < | ||
| - | <meta name=" | ||
| - | < | ||
| - | body {font-family: | ||
| - | /* The side navigation menu */ | ||
| - | .sidenav { | ||
| - | height: 100%; | ||
| - | /* 100% Full-height */ | ||
| - | width: 0; | ||
| - | /* 0 width - change this with JavaScript */ | ||
| - | position: fixed; | ||
| - | /* Stay in place */ | ||
| - | z-index: 1; | ||
| - | /* Stay on top */ | ||
| - | top: 0; | ||
| - | left: 0; | ||
| - | background-color: | ||
| - | /* Black */ | ||
| - | overflow-x: hidden; | ||
| - | /* Disable horizontal scroll */ | ||
| - | transition: 0.5s; | ||
| - | /* Place content 60px from the top */ | ||
| - | padding-top: | ||
| - | /* 0.5 second transition effect to slide in the side nav */ | ||
| - | } | ||
| - | /* The navigation menu links */ | ||
| - | .sidenav a { | ||
| - | padding: 8px 8px 8px 32px; | ||
| - | text-decoration: | ||
| - | font-size: 25px; | ||
| - | color: #818181; | ||
| - | display: block; | ||
| - | transition: 0.3s; | ||
| - | } | ||
| - | /* When you mouse over the navigation links, change their color */ | ||
| - | .sidenav a:hover {color: #f1f1f1;} | ||
| - | /* Position and style the close button (top right corner) */ | ||
| - | .sidenav .closebtn { | ||
| - | position: absolute; | ||
| - | top: 0; | ||
| - | right: 25px; | ||
| - | font-size: 36px; | ||
| - | margin-left: | ||
| - | } | ||
| - | /* Style page content - use this if you want to push the page content | ||
| - | to the right when you open the side navigation */ | ||
| - | #main { | ||
| - | transition: margin-left .5s; padding: 16px;} | ||
| - | /* On smaller screens, where height is less than 450px, | ||
| - | change the style of the sidenav (less padding and a smaller font sixe) */ | ||
| - | @media screen and (max-height: | ||
| - | .sidenav {padding-top: | ||
| - | .sidenav a {font-size: 18px;} | ||
| - | } | ||
| - | </ | ||
| - | </ | ||
| - | < | ||
| - | <div id=" | ||
| - | <a href=" | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | <a href="#"> | ||
| - | </ | ||
| - | <div id=" | ||
| - | < | ||
| - | <p> | ||
| - | Click on the element below to open the side navigation menu, and push this content to the right. <br> | ||
| - | Notice that we add a black see-through background-color to body when the sidenav is opened. | ||
| - | </p> | ||
| - | <span style=" | ||
| - | </ | ||
| - | < | ||
| - | /* Set the width of the side navagation to 250px and the left margin of the page content to 250px */ | ||
| - | function openNav() { | ||
| - | document.getElementById(" | ||
| - | document.getElementById(" | ||
| - | document.body.style.backgroundColor = " | ||
| - | } | ||
| - | /* Set the width of the side navagation to 0 and the left margin of the page content to 0 */ | ||
| - | function closeNav() { | ||
| - | document.getElementById(" | ||
| - | document.getElementById(" | ||
| - | document.body.style.backgroundColor = " | ||
| - | } | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | {{tag> | ||