¾È³çÇϼ¼¿ä ¸ð¹ÙÀÏ¿¡¼ »ç¿ëÇÏ¸é ±¦ÂúÀº jquery ÀÔ´Ï´Ù.
PC ¿¡ »ç¿ëÇصµ »ó°üÀº ¾øÁö¸¸ ¸ð¹ÙÀÏ¿¡ ´õ Àß ¾î¿ï¸±²¨ °°¾Æ¿ä ^^;
±âº»ÀûÀÎ HTML Àº ¾Æ·¡¿Í °°Àº ±¸¼ºÀ» °¡Áö°í ÀÖ½À´Ï´Ù.
<nav id="menu">
<header>
<h2>Menu</h2>
</header>
</nav>
<main id="panel">
<header>
<h2>Panel</h2>
</header>
</main>
½ºÅ¸Àϵµ ´ç¿¬È÷ µû¶ó¿À°ÚÁÒ ^^
body {
width: 100%;
height: 100%;
}
.slideout-menu {
position: fixed;
top: 0;
bottom: 0;
width: 256px;
min-height: 100vh;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
z-index: 0;
display: none;
}
.slideout-menu-left {
left: 0;
}
.slideout-menu-right {
right: 0;
}
.slideout-panel {
position: relative;
z-index: 1;
will-change: transform;
background-color: #FFF; /* A background-color is required */
min-height: 100vh;
}
.slideout-open,
.slideout-open body,
.slideout-open .slideout-panel {
overflow: hidden;
}
.slideout-open .slideout-menu {
display: block;
}
±¸µ¿Çϱâ À§ÇÑ ½ºÅ©¸³Æ®µµ ´ç¿¬È÷ ÀÖ½À´Ï´Ù.
<script src="dist/slideout.min.js"></script>
<script>
var slideout = new Slideout({
'panel': document.getElementById('panel'),
'menu': document.getElementById('menu'),
'padding': 256,
'tolerance': 70
});
// Toggle button
document.querySelector('.toggle-button').addEventListener('click', function() {
slideout.toggle();
});
</script>
¾ÐÃàÆÄÀÏ ÇØÁ¦ ÇϽøé test Æú´õ¾È¿¡ index.html, index.right.html 2°³°¡ ÀÖ°í µÑ´Ù ¹®Á¦ ¾øÀÌ ÀÛµ¿Àº ÇÕ´Ï´Ù.
±×·¯³ª index.html Àº °³¹ßÀÚ°¡ ¸Þ´º°¡ ÀÛµ¿ÇÏ´Â°É º¸¿©ÁÖ±â À§ÇØ °Á¦·Î 2¹ø Á¤µµ ¸Þ´º°¡ ¿òÁ÷À̵µ·Ï ÇØ µÎ¾ú³×¿ä.
¼Ò½º ÇÏ´Ü¿¡ º¸½Ã¸é var runner = mocha.run(); Àִµ¥¿ä. ÁÖ¼®Ã³¸®ÇϽøé ÀÚµ¿ ¸Þ´º ¿òÁ÷À̴°Š¸·À» ¼ö ÀÖ½À´Ï´Ù.
Âü°íÇϼż ÀÌ»Û ¸ð¹ÙÀÏ »çÀÌÆ® ¸¸µé¾î º¸¼¼¿ä ^^
https://github.com/Mango/slideout ¿¡ Á¢¼ÓÇÏ½Ã¸é ¿É¼Ç, À̺¥Æ® µé¿¡ ´ëÇÑ API ¹®¼°¡ ÀÖÀ¸´Ï ÇÊ¿äÇϽøé Âü°í ÇϽñ⠹ٶø´Ï´Ù.
|