HTML-НИЗ
Код:
<script type="text/javascript"> $(document).ready(function(){ $('.splLink').click(function(){ $(this).parent().children('div.splCont').toggle('normal'); return false; }); }); </script> <script type="text/javascript"> $(document).ready(function() { $(".tab_content").hide(); $("ul.tabs li:first").addClass("active").show(); $(".tab_content:first").show(); $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".tab_content").hide(); var activeTab = $(this).find("a").attr("href"); $(activeTab).fadeIn(); return false; }); }); </script>
HTML-ВЕРХ
Код:
<style> .container1 {width: 900px; margin: 0 auto; padding: 0;} ul.tabs { margin: 0; padding: 0; float: left; list-style: none; height: 40px; width: 467px; width: 100%;} ul.tabs li { float: left; margin: 0; padding: 0; height: 40px; line-height: 40px; border: 0px; border-top: 1px dotted #000000; border-bottom: 1px dotted #000000; border-right: 1px dotted #000000; border-left: 1px dotted #000000; margin-bottom: -2px; background: url(); overflow: hidden; position: relative;} ul.tabs li a { text-decoration: none; color: transparent; display: block; padding: 0 5px; background: url(); outline: none;} ul.tabs li a:hover { background: url(); border-bottom: 0px solid #000000; border-top: 0px solid #000000; border-left: 0px solid #000000; border-right: 0px solid #000000; } html ul.tabs li.active { background: url(); border-bottom: 0px solid #000000; border-top: 0px solid #000000; border-left: 0px solid #000000; border-right: 0px solid #000000; } html ul.tabs li.active a:hover { background: url(); border-bottom: 0px solid #160f0a;} .tab_container1 { clear: both; float: left; width: 900px; height: 343px; background-image : url(); background-color: #FFFFFF; border-bottom: 1px solid #000000; border-top: 0px solid #000000; border-left: 0px solid #000000; border-right: 0px solid #000000; -moz-border-radius-bottomright: 5px; -khtml-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-bottomleft: 5px; -khtml-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px;} .tab_content { padding: 5px;} .tab_content h2 { font-weight: normal; padding-bottom: 2px; border-bottom: 0px dashed #000000;} </style>
ОБЪЯВЛЕНИЕ
Код:
<div class="container"> <div class="html-box"> <ul class="tabs"> <li class="active"><a href="#tab1">Вкладка 1</a></li> <li><a href="#tab2">Вкладка 2</a></li> <li><a href="#tab3">Вкладка 3</a></li> </ul> <div class="tab_container1"> <div style="display: block;" id="tab1" class="tab_content"> текст 1 </div> <div style="display: none;" id="tab2" class="tab_content"> текст 2 </div> <div style="display: none;" id="tab3" class="tab_content"> текст 3 </div> </div> </div> </div>