Jquery basic trigger
by Matthew Day
HTML
<div id="outer">
<div id="inner">
<div id="content">
<div class="contact-title">Inquiries</div>
<p>[email protected]</p>
<div class="contact-title">Address</div>
<p>Vertical Capital, LLC<br>437 Madison Avenue,<br>39th Floor<br>New York, NY 10022</p>
<div class="contact-title">Phone</div>
<p>212.786.5300</p>
</div>
</div>
</div>
<div class="trigger">Trig</div>
CSS
/* http://meyerweb.com/eric/tools/css/reset/ */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
caption, tbody, tfoot, thead,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* http://www.paulirish.com/2012/box-sizing-border-box-ftw */
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* WebKit tap highlighting */
* {
-webkit-tap-highlight-color: #000;
}
/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */
.clearfix:before,
.clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
.clearfix {
zoom: 1;
}
* {
box-sizing: border-box;
}
#outer {
position: fixed;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: #003D71;
transition: all 1s ease-in-out;
}
#outer.active {
left: 0;
}
#inner {
position: relative;
width: calc(100% - 20px);
height: calc(100% - 20px);
margin: 10px;
background: #fff;
}
#content {
position: absolute;
top: 10px;
right: 10px;
...
JavaScript
$(document).ready(function() {
$('.trigger').click(function(){
$('#outer').toggleClass('active');
});
});