Skip to content

Instantly share code, notes, and snippets.

@jomasero
Created July 14, 2014 00:04
Show Gist options
  • Select an option

  • Save jomasero/aa2f0dc853a15083e724 to your computer and use it in GitHub Desktop.

Select an option

Save jomasero/aa2f0dc853a15083e724 to your computer and use it in GitHub Desktop.
Horizontal jQueryUI Tabs
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Tabs - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
$( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
});
</script>
<style>
.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
.ui-tabs-vertical .ui-tabs-nav li a { display:block; }
.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
.ui-tabs-vertical .ui-tabs-panel { margin-left: 200px; padding: 1em; }
#tabs .scroller {
max-width: 200px;
float: left;
overflow: hidden;
}
#tabs .scroller:hover { overflow-y: auto; }
#tabs ul {
/*width: 1660px;*/
max-height: 400px;
}
</style>
</head>
<body>
<div id="tabs">
<div class="scroller">
<ul>
<li><a href="#tabs-1">La #1</a></li>
<li><a href="#tabs-2">La #2</a></li>
<li><a href="#tabs-3">La #3</a></li>
<li><a href="#tabs-4">La #4</a></li>
<li><a href="#tabs-5">La #5</a></li>
<li><a href="#tabs-6">La #6</a></li>
</ul>
</div>
<div id="tabs-1">
<p>Hola</p>
</div>
<div id="tabs-2">
<p>Mundo</p>
</div>
<div id="tabs-3">
<p>Marte</p>
</div>
<div id="tabs-4">
<p>Venus</p>
</div>
<div id="tabs-5">
<p>Mercurio</p>
</div>
<div id="tabs-6">
<p>Toast</p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment