Fixed tabs
This commit is contained in:
parent
3ab6de6a51
commit
b3d7b8e413
|
@ -19,10 +19,10 @@ div.product div.summary{float:right;width:300px;}
|
|||
div.product div.social{text-align:right;margin:0 0 1em;}div.product div.social span{margin:0 0 0 2px;}div.product div.social span span{margin:0;}
|
||||
div.product div.social span .stButton .chicklets{padding-left:16px;width:0;}
|
||||
div.product div.social iframe{float:left;margin-top:3px;}
|
||||
div.product #tabs{clear:both;padding:1em 0 0 0;margin:0 0 1em 0;}div.product #tabs ul.tabs{-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-radius-topleft:3px;-moz-border-radius-topright:3px;border-top-left-radius:3px;border-top-right-radius:3px;background:#ddd;overflow:hidden;zoom:1;margin:0;padding:4px 4px 0;list-style:none outside;}div.product #tabs ul.tabs li{float:left;margin:0 4px 0 0;font-size:0.92em;}
|
||||
div.product #tabs ul.tabs a{float:left;padding:6px 12px;background:#eee;text-decoration:none;-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px;}
|
||||
div.product #tabs ul.tabs li.active a{background:#fff;color:#555;}
|
||||
div.product #tabs .panel{border:1px solid #ddd;border-top:0;padding:15px 15px 0;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;}
|
||||
div.product .woocommerce_tabs{clear:both;padding:1em 0 0 0;margin:0 0 1em 0;}div.product .woocommerce_tabs ul.tabs{-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-radius-topleft:3px;-moz-border-radius-topright:3px;border-top-left-radius:3px;border-top-right-radius:3px;background:#ddd;overflow:hidden;zoom:1;margin:0;padding:4px 4px 0;list-style:none outside;}div.product .woocommerce_tabs ul.tabs li{float:left;margin:0 4px 0 0;font-size:0.92em;}
|
||||
div.product .woocommerce_tabs ul.tabs a{float:left;padding:6px 12px;background:#eee;text-decoration:none;-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px;}
|
||||
div.product .woocommerce_tabs ul.tabs li.active a{background:#fff;color:#555;}
|
||||
div.product .woocommerce_tabs .panel{border:1px solid #ddd;border-top:0;padding:15px 15px 0;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;}
|
||||
.stock{color:green;float:left;}
|
||||
.out-of-stock{color:red;}
|
||||
p.cart{float:right;}
|
||||
|
|
|
@ -218,7 +218,7 @@ div.product {
|
|||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
#tabs {
|
||||
.woocommerce_tabs {
|
||||
clear: both;
|
||||
padding: 1em 0 0 0;
|
||||
margin: 0 0 1em 0;
|
||||
|
|
|
@ -217,24 +217,29 @@ jQuery(function(){
|
|||
}).change();
|
||||
|
||||
/* Tabs */
|
||||
jQuery('#tabs .panel:not(#tabs .panel)').hide();
|
||||
jQuery('#tabs li a').click(function(){
|
||||
jQuery('div.woocommerce_tabs .panel').hide();
|
||||
jQuery('div.woocommerce_tabs ul.tabs li a').click(function(){
|
||||
|
||||
var tabs_wrapper = jQuery(this).closest('div.woocommerce_tabs');
|
||||
var href = jQuery(this).attr('href');
|
||||
jQuery('#tabs li').removeClass('active');
|
||||
jQuery('div.panel').hide();
|
||||
|
||||
jQuery('ul.tabs li.active', tabs_wrapper).removeClass('active');
|
||||
jQuery('div.panel', tabs_wrapper).hide();
|
||||
jQuery('div' + href).show();
|
||||
jQuery(this).parent().addClass('active');
|
||||
jQuery.cookie('current_tab', href);
|
||||
return false;
|
||||
|
||||
return false;
|
||||
});
|
||||
jQuery('div.woocommerce_tabs').each(function() {
|
||||
if (jQuery('ul.tabs li.active', jQuery(this)).size()==0) {
|
||||
jQuery('ul.tabs li:first a', jQuery(this)).click();
|
||||
} else {
|
||||
jQuery('ul.tabs li.active a', jQuery(this)).click();
|
||||
}
|
||||
});
|
||||
if (jQuery('#tabs li.active').size()==0) {
|
||||
jQuery('#tabs li:first a').click();
|
||||
} else {
|
||||
jQuery('#tabs li.active a').click();
|
||||
}
|
||||
|
||||
/* Shipping calculator */
|
||||
|
||||
jQuery('.shipping-calculator-form').hide();
|
||||
|
||||
jQuery('.shipping-calculator-button').click(function() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -156,15 +156,11 @@ if (!function_exists('woocommerce_output_product_data_tabs')) {
|
|||
if (isset($_COOKIE["current_tab"])) $current_tab = $_COOKIE["current_tab"]; else $current_tab = '#tab-description';
|
||||
|
||||
?>
|
||||
<div id="tabs">
|
||||
<div class="woocommerce_tabs">
|
||||
<ul class="tabs">
|
||||
|
||||
<?php do_action('woocommerce_product_tabs', $current_tab); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php do_action('woocommerce_product_tab_panels'); ?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
|
Loading…
Reference in New Issue