검색결과 리스트
javascript에 해당되는 글 7건
- 2016.05.10 ( CSS & Javascript ) 슬라이드 메뉴 만들기
글
이건 모바일에서 가장 많이 쓰이는 방법중에 하나 입니다.
물론 다른곳에도 쓰이구요.
부족한 화면에 메뉴를 숨겨뒀다가 땡겨오는거죠.
크롬, IE10에서만 확인했다는거...
1. 제작 과정
2. 완성본
Menu 1
Menu 2
Menu 3
Menu 4
Menu 5
Close
3. 소스 부분
3-1. CSS 부분
<style>
html, body {
margin: 10 10;
}
.VirtualView {
width: 400px;
height: 600px;
overflow: hidden;
border: 1px;
border-style: double;
position: relative;
}
.hideMenuBody {
width: 150px;
height: 100%;
background-color: #4d4d4d;
padding-top: 100px;
transition: transform 600ms;
transform: translate(-150px, 0px);
-ms-transition: -ms-transform 600ms;
-webkit-transition: -webkit-transform 600ms;
-moz-transition: -moz-transform 600ms;
-o-transition: -o-transform 600ms;
-ms-transform: translate(-150px, 0px);
-webkit-transform: translate(-150px, 0px);
-moz-transform: translate(-150px, 0px);
-o-transform: translate(-150px, 0px);
}
.hideMenuBody > div {
width: 150px;
height: 30px;
line-height: 30px;
vertical-align: middle;
text-align: center;
color: #ffffff;
cursor: pointer;
margin-bottom: 5px;
box-shadow: 1px 1px 0px #ffffff;
}
.hideMenuBody > div:hover {
background-color: #808080;
}
.circleBt {
width: 50px;
height: 50px;
position: absolute;
bottom: 10px;
left: 10px;
border-radius: 25px;
cursor: pointer;
background: radial-gradient(#4d4d4d 50%, #ffffff 60%, #4d4d4d 10%);
}
.circleBt:hover {
background: radial-gradient(#A5A5A5 50%, #ffffff 60%, #A5A5A5 10%);
}
.circleBt > div {
width: 24px;
height: 5px;
background-color: #ffffff;
margin-top: 5px;
margin-left: 13px;
}
</style>
3-2. Javascript 부분
<script>
function showLeftMenu(){
var circleBtObj = document.getElementById('circleBt');
var leftMenuObj = document.getElementById('hideMenuBodyId');
circleBtObj.style['display'] = "none";
leftMenuObj.style['transform'] = "translate(0px, 0px)";
leftMenuObj.style['msTransform'] = "translate(0px, 0px)";
leftMenuObj.style['mozTransform'] = "translate(0px, 0px)";
leftMenuObj.style['webkitTransform'] = "translate(0px, 0px)";
leftMenuObj.style['oTransform'] = "translate(0px, 0px)";
}
function closeLeftMenu() {
var circleBtObj = document.getElementById('circleBt');
var leftMenuObj = document.getElementById('hideMenuBodyId');
circleBtObj.style['display'] = "block";
leftMenuObj.removeAttribute("style");
}
</script>
3-3. HTML 부분
<div class="VirtualView"> <div class="hideMenuBody" id="hideMenuBodyId"> <div>Menu 1</div> <div>Menu 2</div> <div>Menu 3</div> <div>Menu 4</div> <div>Menu 5</div> <div onclick="closeLeftMenu(); return false;">Close</div> </div> <div class="circleBt" id="circleBt" onclick="showLeftMenu(this); return false;"> <div style="margin-top: 13px;"></div> <div></div> <div></div> </div> </div>
'Programing > Web' 카테고리의 다른 글
| mobile web 작업시 safari 브라우저에서 투터치 줌 막기 (0) | 2020.09.25 |
|---|---|
| ( CSS ) iconfonts 관련 사이트 (0) | 2016.09.02 |
| ( CSS ) 심플한 드랍다운 메뉴 만들기 (10) | 2016.05.10 |
| ( CSS ) 아주심플하면서 이쁜 메뉴 만들기! (0) | 2016.05.10 |
| ( Web ) 스케쥴 관리 웹 만들기 (0) | 2016.05.02 |
RECENT COMMENT