Created
October 22, 2012 11:51
-
-
Save netsi1964/3931184 to your computer and use it in GitHub Desktop.
A CodePen by Sten Hougaard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container-fluid"> | |
<h1>Slide test</h1> | |
<div id="menu"> | |
<strong>Menu</strong> | |
<ul> | |
<li><a href="">no 1</a></li> | |
<li><a href="">no 2</a></li> | |
<li><a href="">no 3</a></li> | |
<li><a href="">no 4</a></li> | |
<li><a href="">no 5</a></li> | |
</ul> | |
</div> | |
<div id="content"> | |
<a href="#" id="toggle">toggle</a> | |
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function() { | |
jQuery('#toggle').on('click', function() { | |
jQuery('#menu, #content').toggleClass('active'); | |
}); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#menu, #contant {float: left; | |
transition: left 1s; | |
} | |
#menu {background: rgba(255,255,255,.3); width: 200px; padding: 10px; position: absolute; left: -210px;} | |
#menu.active {left: 0px;} | |
#content {position: relative; left: 0px;} | |
#content.active {left: 220px;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment