- <script type="text/javascript">//<![CDATA[
- window.addEvent('load', function() {
- $("#simple-tabs .tab_content").hide(); //Hide all content
- $("#simple-tabs ul.tabs li:first").addClass("active").show(); //Activate first tab
- $("#simple-tabs .tab_content:first").show(); //Show first tab content
- //On Click Event
- $("#simple-tabs ul.tabs li").click(function(e) {
- $("#simple-tabs ul.tabs li").removeClass("active"); //Remove any "active" class
- $(this).addClass("active"); //Add "active" class to selected tab
- $("#simple-tabs .tab_content").hide(); //Hide all tab content
- var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
- $(activeTab).fadeIn(); //Fade in the active content
- $('.video-container iframe[src*="http://www.youtube.com/embed/"]').each(function(i) {
- this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
- });
- e.preventDefault();
- });
- (function($) {
- $('.tab ul.tabs li:first-child a').addClass('current');
- $('.tab .tab_content div.tabs_tab:first-child').show();
- $('.tab ul.tabs li a').click(function(g) {
- var tab = $(this).parent().parent().parent(),
- index = $(this).parent().index();
- tab.find('ul.tabs').find('a').removeClass('current');
- $(this).addClass('current');
- tab.find('.tab_content').find('div.tabs_tab').not('div.tabs_tab:eq(' + index + ')').slideUp();
- tab.find('.tab_content').find('div.tabs_tab:eq(' + index + ')').slideDown();
- g.preventDefault();
- });
- })(jQuery);
- });//]]>
- </script>
- <div id="simple-tabs">
- <ul class="tabs">
- <li><a href="#tab1">Simple Slider</a></li>
- <li><a href="#tab2">Static Image</a></li>
- <li><a href="#tab3">Embedded Video</a></li>
- </ul>
- <div class="tab_container">
- <div id="tab1" class="tab_content">
- Tab1
- </div>
- <div id="tab2" class="tab_content">
- Tab2
- </div>
- <div id="tab3" class="tab_content">
- Tab3
- </div>
- </div>
- <div class="clear"></div>
- </div>
- /* Tabs
- ---------------------------------------- */
- #simple-tabs ul.tabs
- {
- margin-right:40px;
- margin-left:50px;
- padding:0;
- float:left;
- list-style:none;
- height:58px;
- width:100%;
- }
- #simple-tabs ul.tabs li
- {
- float:left;
- margin-right:10px;
- padding:0;
- height:54px;
- line-height:54px;
- margin-bottom:-1px;
- overflow:hidden;
- position:relative;
- background:#5d6872;
- }
- #simple-tabs ul.tabs li a
- {
- text-decoration:none;
- display:block;
- padding:0 30px;
- outline:none;
- color:#FFF;
- }
- #simple-tabs ul.tabs li a:hover
- {
- background:#CCC;
- }
- #simple-tabs ul.tabs li.active
- {
- background:#FFF;
- border:1px dotted #CCC;
- border-bottom: none;
- height:58px;
- }
- #simple-tabs ul.tabs li.active a
- {
- color:#555;
- }
- #simple-tabs ul.tabs li.active a:hover
- {
- background: none;
- }
- #simple-tabs .tab_container
- {
- border-top:1px dotted #ccc;
- overflow:hidden;
- clear:both;
- float:left;
- width:100%;
- background:#FFF;
- }
- #simple-tabs .tab_content
- {
- padding:70px 50px 0 50px;
- }