Skip to content

Instantly share code, notes, and snippets.

@1995eaton
Created July 2, 2014 02:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1995eaton/a383fd279902e1158f7f to your computer and use it in GitHub Desktop.
Save 1995eaton/a383fd279902e1158f7f to your computer and use it in GitHub Desktop.
jQuery
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
-webkit-font-smoothing: subpixel-antialiased;
}
#links {
display: block;
color: #ddd;
background-color: #a10808;
font-family: Helvetica, Neue, sans-serif, Arial;
font-weight: 200;
font-size: 10pt;
text-align: center;
user-select: none;
-webkit-user-select: none;
}
#container-main {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
}
#sidebar {
position: absolute;
display: block;
background:#a10808;
top: 0; left: 0;
height: 100%; width: 150px;
margin: 0; padding: 0;
}
#sidebar li {
display: block;
padding: 5px;
cursor: pointer;
border-bottom: 1px solid rgba(0,0,0,0.25);
transition: background-color 0.2s ease-out, color 0.2s ease-out;
}
/* Mess with colors here */
/* These styles will active on mouseover */
#sidebar li:hover {
background-color: rgba(255,255,255,0.5);
color: #000;
}
iframe {
position: absolute;
height: 100%; width: calc(100% - 150px);
top: 0; left: 150px;
background-color: #bbb;
box-shadow: -2px 0px 15px rgba(0,0,0,0.5);
z-index: 1;
display: none;
}
</style>
</head>
<body>
<div id="container-main">
<ul id="sidebar">
<li class="Exe" data-frame=".ExeRpt" id="links">Exect Dashboard</li>
<li class="Area" data-frame=".AreaRpt" id="links">Area Metrics</li>
<li class="CS" data-frame=".CSRpt" id="links">CS Dashboard</li>
<li class="Comp" data-frame=".CompRpt" id="links">DB Comparison</li>
<li class="Def" data-frame=".DefRpt" id="links">Definitions</li>
<li class="Matrix" data-frame=".MatrixRpt" id="links">dbMatrix</li>
<li class="Tech" data-frame=".TechRpt" id="links">Tech Dashboad</li>
<li class="Trend" data-frame=".TrendRpt" id="links">Trend Report</li>
</ul>
<iframe class="ExeRpt" frameBorder="0" src="about:blank" scrolling="no" style="display: block"> </iframe>
<iframe class="AreaRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="CSRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="CompRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="DefRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="MatrixRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="TechRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
<iframe class="TrendRpt" frameBorder="0" src="about:blank" scrolling="no"> </iframe>
</div>
</body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script>
(function($) {
// First <iframe> element to be shown
var activePane = $('.ExeRpt');
$('li[data-frame]').each(function() {
$(this).click(function() {
if ($($(this).attr('data-frame')).is(':visible')) {
return;
}
activePane.hide({ width: 'toggle' });
activePane = $($(this).attr('data-frame'));
activePane.show({ width: 'toggle' });
});
});
})(jQuery);
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment