Tweak - GTM listener for wc-tabs using preventDefault()

This commit is contained in:
Shiva Poudel 2015-08-21 21:27:34 +05:45
parent bbb00d9a3a
commit 5d291495a7
1 changed files with 2 additions and 2 deletions

View File

@ -34,13 +34,13 @@ jQuery( function ( $ ) {
// Tabbed Panels
$( document.body ).on( 'wc-init-tabbed-panels', function() {
$( 'ul.wc-tabs' ).show();
$( 'ul.wc-tabs a' ).click( function() {
$( 'ul.wc-tabs a' ).click( function( e ) {
e.preventDefault();
var panel_wrap = $( this ).closest( 'div.panel-wrap' );
$( 'ul.wc-tabs li', panel_wrap ).removeClass( 'active' );
$( this ).parent().addClass( 'active' );
$( 'div.panel', panel_wrap ).hide();
$( $( this ).attr( 'href' ) ).show();
return false;
});
$( 'div.panel-wrap' ).each( function() {
$( this ).find( 'ul.wc-tabs li' ).eq( 0 ).find( 'a' ).click();