2014-05-20 65 views
1

我現在的工作是this website,有3個手風琴提供服務列表。我無法弄清楚如何使手風琴默認關閉。需要在WordPress網站默認關閉手風琴

此外,一些手風琴選項卡之間還有很多額外的空白空間,我無法弄清楚原因。

這是 「頭」 文件:

<style> 
.text-color, a.link-big:hover, .navbar .nav > li > a:hover, .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle, .portfolio-image:after, .blog-post h3 a:hover, footer .tweet_list .tweet_text a , .nav-pills > li > a:hover, .accordion-heading a, .home-header .link:hover 
{ color: #a9cc54; } 

這是身體:

<div class="wpb_accordion wpb_content_element not-column-inherit" data-collapsible=yes> 
    <div class="wpb_wrapper wpb_accordion_wrapper ui-accordion"> 
     <div class="wpb_accordion_section group"> 
      <h3 class="wpb_accordion_header ui-accordion-header"><a href="#">Content Creation &amp; Posting</a></h3> 
      <div class="wpb_accordion_content ui-accordion-content clearfix"> 
       <div class=" align-left" style="color:;"> 
        <ul> 
         <li>Facebook</li> 
         <li>Twitter</li> 
         <li>Instagram</li> 
         <li>FourSquare</li> 
         <li>Pinterest</li> 
         <li>LinkedIn &amp; More&#8230;</li> 
        </ul> 
       </div> 
      </div> 
     </div> 

這對js_composer_front.js

if (typeof window['vc_accordionBehaviour'] !== 'function') { 
    function vc_accordionBehaviour() { 
     jQuery('.wpb_accordion').each(function(index) { 
      var $tabs, 
       interval = jQuery(this).attr("data-interval"); 
      // 
      $tabs = jQuery(this).find('.wpb_accordion_wrapper').accordion({ 
       header: "> div > h3", 
       autoHeight: false, 
       collapsible: jQuery(this).data('collapsible') === 'yes', 
       change: function(event, ui){ 
        if(jQuery.fn.isotope!=undefined) { 
         ui.newContent.find('.isotope').isotope("reLayout"); 
        } 
        vc_carouselBehaviour(); 
       } 
      }); 
      //.tabs().tabs('rotate', interval*1000, true); 
     }); 
    } 
} 

回答

0

爲了讓所有的手風琴不活躍,我們將active option更改爲false

add_action('wp_footer', 'minimize_accordion_so_23758086'); 

function minimize_accordion_so_23758086() 
{ 
    # Not home or front page, bail out 
    if(!is_home() || !is_front_page()) 
     return; 

    ?> 
    <script type="text/javascript"> 
    jQuery(document).ready(function($) 
    { 
     $('.wpb_accordion').each(function(index) 
     { 
      $(this).find('.wpb_accordion_wrapper').accordion("option", "active", false); 
     }); 
    }); 
    </script> 
    <?php 
} 

Where do I put the code snippets I found here or somewhere else on the web?

要解決的間距問題,請按照提示從Chrome DevTools或Firebug插件的Firefox

Chrome inspector