JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<nav role="navigation">
<ul class="nav">
<li><a data-target="nav__one">1</a></li>
<li><a data-target="nav__two">2</a></li>
</ul>
</nav>
<nav class="nav__sec nav__one">
<ul>
<li>1 Link 1</li>
<li>1 Link 2</li>
<li>1 Link 3</li>
<li>and so on ...</li>
</ul>
</nav>
<nav class="nav__sec nav__two">
<ul>
<li>2 Link 1</li>
<li>2 Link 2</li>
<li>2 Link 3</li>
<li>2 Link 4</li>
<li>2 Link 5</li>
<li>2 Link 6</li>
<li>and so on ...</li>
</ul>
</nav>
<main role="main">
It and principles are tied to leave room for the point is unobtrusive. It does not it does not the other four parts? Good design process show respect towards the absence of data they are closer approximations to be arbitrary or stay at one level of british culture, these tasks that form and tolerant, that, design makes a very minimalist way something intelligible and going and confusion are discoverable truths, you go, and value, measured more than the whole thing about the leading edge in colour.
<p>
Clutter is worthwhile to say, 'yeah, nature's laws are like overheads, well, low resolution, and in colour makes a purpose are neither decorative objects we're playing. Good design. What was have a clutterfree product more than the mode of clutter and restrained, in trying to leave room for the value on so much that is to the absence of information that we have disconnected function.
</p>
http://www.designeripsum.com/
</main>
body{
padding:0;
margin:0;
font-size: 12px; /* pretty important */
}
[role="navigation"] {
background-color: #1f2429;
color: #FFF;
font-size:2.8em;
height: 100%;
width: 60px;
z-index: 2;
position: fixed;
}
.nav {
list-style:none;
padding:0;
margin:0;
line-height:60px;
}
.nav li {
text-align:center;
cursor: pointer;
}
.nav__sec {
background-color: #2b323a;
position: fixed;
height: 100%;
z-index: 1;
color: #FFF;
width: 250px;
margin-left: -20.8em;
overflow: auto;
}
.nav__sec.show {
margin-left: 5em;
}
[role="main"] {
margin-left: 70px;
font-size: 1.5em;
padding-top:1em;
}
.nav__sec {
-webkit-transition: 0.3s;
transition: 0.3s;
}
//using jQuery but also works in Zepto
function clearAll() {
$('.nav__sec, nav a').removeClass('show');
};
$('main').click(function() {
clearAll();
});
$('.nav a').click(function(){
var n = $(this);
var r = $("." + n.data("target"));
if(n.hasClass("show")){
n.removeClass('show'), r.removeClass('show');
} else {
clearAll(), n.addClass('show'), r.addClass('show');
}
});
Also see: Tab Triggers