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.
<h1 class="title">FanTabulous</h1>
<div class="codepen-container">
<div id="icetab-container">
<div class="icetab current-tab">Tab1</div><div class="icetab">Tab2</div><div class="icetab">Tab3</div>
</div>
<div id="icetab-content">
<div class="tabcontent tab-active">Tab1 <br>1 lorim ipsum</div>
<div class="tabcontent">Tab2 <br>2 lorim ipsum</div>
<div class="tabcontent">Tab3 <br>23 lorim ipsum</div>
</div>
div {
box-sizing: border-box;
transition: all ease-in-out .5s;
-moz-transition: all ease-in-out .5s;
-webkit-transition: all ease-in-out .5s;
}
.icetab {
border: 2px solid #ff9900;
display: inline-block;
border-bottom: 0px;
margin: 0px;
color: #fff;
cursor: pointer;
border-right: 0px;
}
.icetab:last-child {
border-right: 2px solid #ff9900;
}
#icetab-content {
overflow: hidden;
position: relative;
border-top: 2px solid #ff9900;
}
.tabcontent {
position: absolute;
left: 0px;
top: 0px;
background: #fff;
width: 100%;
border-top: 0px;
border: 2px solid #ff9900;
border-top: 0px;
transform: translateY(-100%);
-moz-transform: translateY(-100%);
-webkit-transform: translateY(-100%);
}
.tabcontent:first-child {
position: relative;
}
.tabcontent.tab-active {
border-top: 0px;
display: block;
transform: translateY(0%);
-moz-transform: translateY(0%);
-webkit-transform: translateY(0%);
}
/* A tiny wee bit of visual formating */
body {
font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
background: #666;
color: #454545;
}
.codepen-container {
max-width: 700px;
margin: 40px;
margin-left: auto;
margin-right: auto;
}
.title {
color: #ff9900;
text-align: center;
letter-spacing: 14px;
text-transform: uppercase;
font-size: 17px;
margin: 40px 0px;
}
.tabcontent {
padding: 40px;
}
.icetab {
padding: 20px;
text-transform: uppercase;
letter-spacing: 2px;
}
.current-tab {
background: #ff9900;
}
var tabs = document.getElementById('icetab-container').children;
var tabcontents = document.getElementById('icetab-content').children;
var myFunction = function() {
var tabchange = this.mynum;
for(var int=0;int<tabcontents.length;int++){
tabcontents[int].className = ' tabcontent';
tabs[int].className = ' icetab';
}
tabcontents[tabchange].classList.add('tab-active');
this.classList.add('current-tab');
}
for(var index=0;index<tabs.length;index++){
tabs[index].mynum=index;
tabs[index].addEventListener('click', myFunction, false);
}
Also see: Tab Triggers