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.
<div class="temp-wrap">
<header>
<img class="logo" src="http://qwerty-demos.co.uk/jay-be-logo.png" alt="">
<nav class="mobile-nav-wrap" role="navigation">
<div class="nav-container">
<ul class="mobile-header-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Where to Buy</a></li>
<li><a href="#">Guarantee</a></li>
<li><a href="#">Our Story</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Where to Buy</a></li>
<li><a href="#">Guarantee</a></li>
<li><a href="#">Our Story</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Where to Buy</a></li>
<li><a href="#">Guarantee</a></li>
<li><a href="#">Our Story</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
<a class="hamburger-menu" href="#">
<span class="menu-item"></span>
<span class="menu-item"></span>
<span class="menu-item"></span>
</a>
</header>
<section>
<p style="font-size:8rem;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 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>
</section>
</div>
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html.noscroll {
overflow: hidden;
}
.temp-wrap {
max-width: 80rem;
margin: 0 auto;
}
body.noscroll {
overflow: visible;
height: 100%;
}
.mobile-menu-toggle {
z-index: 7000;
}
.logo {
position: absolute;
width: 700px;
height: auto;
top: 0;
left: 50%;
-webkit-transform: translate(-50%, 0);
transform: translate(-50%, 0);
z-index: 100;
pointer-events: none;
}
body {
padding-top: 100px;
}
header {
-webkit-box-shadow: 0 -0.2rem 0.6rem rgba(0, 0, 0, 0.4);
box-shadow: 0 -0.2rem 0.6rem rgba(0, 0, 0, 0.4);
height: 100px;
position: fixed;
width: 100%;
top: 0;
left:0;
z-index: 10;
}
.mobile-nav-wrap {
position: fixed;
width: 100%;
height: 100%;
top: 100px;
background: gold;
display: none;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
-webkit-box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.4);
box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.4);
}
.nav-container {
background: gold;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left:0;
}
.mobile-header-nav {
list-style: none;
margin: 30px 0 0 0;
padding: 0;
width: 100%;
height: 100%;
}
.mobile-header-nav li {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
margin-left: 30px;
margin-right: 30px;
}
.mobile-header-nav li a {
color: black;
display: block;
font-size: 26px;
padding: 35px 0 35px 25px;
text-decoration: none;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.mobile-header-nav li a:hover {
background-color: #2f2f2f;
color: white;
}
.hamburger-menu {
display: inline-block;
padding: 35px 25px;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.hamburger-menu:hover {
cursor: pointer;
}
.menu-item {
background: #252525;
display: block;
height: 4px;
margin: 0 0 10px;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
width: 35px;
}
.hamburger-menu.open .menu-item {
margin-bottom:10px;
}
.hamburger-menu.open .menu-item:first-child {
transform: rotate(45deg);
transform-origin: 5px;
}
.hamburger-menu.open .menu-item:nth-child(2) {
opacity: 0;
}
.hamburger-menu.open .menu-item:nth-child(3) {
transform: rotate(-45deg);
transform-origin: 3px;
background: red;
}
// open mobile menu
$('.hamburger-menu').click(function(e){
e.preventDefault();
$('.mobile-nav-wrap').slideToggle();
$(this).toggleClass('open');
$('html, body').toggleClass('noscroll');
});
Also see: Tab Triggers