Hello, thanks for a great module.
I have a quicktabs rendered as an accordion, and everything works great. I want to know if it's possible to have all tabs closed by default. At the moment it seems to me you have to select a default tab to be 'open' on page load.
Sorry if I've missed something obvious.

Any help would be greatly appreciated.

Thanks

Comments

webguyinternet’s picture

Ditto, Looking for this functionality as well.

jcassano’s picture

Version: 7.x-3.0 » 7.x-3.4
Category: support » feature

Also looking for this functionality. My guess is that it doesn't exist currently because with the accordion renderer is newer and with the normal quicktabs renderer it would be impossible to have no tab selected. So I think this needs to be added in as a feature specifically under the accordion renderer UI options.

Anonymous’s picture

any plan to implement this as an option?

I did solve it temporarily by adding the following jQuery to my theme:

jQuery(document).ready(function(){
    jQuery("#id-of-my-custom-block h3:first").trigger('click');
});
brandy.brown’s picture

I need this functionality as well. What do you mean you added it to your theme? Where exactly did you put that code? Thanks!

webguyinternet’s picture

This solution solved it for me as well, but it starts out opened then closes. So it is a little annoying, but it works.
Where the javascript is located is dependent on your theme but most are in the {theme dir}/js/theme.js
You can just add the above code (replacing what needs to be replaced of course) at the end of the theme.js file.

jdonson’s picture

IMHO, I think that should be avalable across ALL drupal pages.

Closed by default is tighter high-level presentation.

Who wants to scroll 10 pages to the right module section? NOT I!

Cardo’s picture

What I've done until a real solution is implemented on the module (which I think is a must) is to add a tab at the beggining of the accordion set, with near-empty title and content, and then remove() it with jQuery (hiding it causes unexpected results and trigger-clicking shows all content on load and then animates a 'close').

$(document).ready(function() {
	$("#quickset-tabs_TAB_MACHINE_NAME h3:first").remove();
	$("#quickset-tabs_TAB_MACHINE_NAME .ui-accordion-content:first").remove();
});

That would do the trick, although often with some minor blinks.

Still waiting for the feature, though :)

dadderley’s picture

@nathan6137
Thanks for this Nathan -- it is a good temporary fix.

Add me to the list of people wanting this to be a feature of the module.

neRok’s picture

My simple solution to have my accordian collapsed by default was to make a tab (I called it Hidden for ease of use), set it to display a node, but dont give it a NID. I enabled 'Hide empty tabs', and set my Hidden tab to the default. When the page loads, the Hidden tab is not shown, and all the other tabs are collapsed.

dadderley’s picture

@nathan6137
The jquery you have works very well, but it has the unfortunate side effect of mimicking a linked anchor. To stop this effect, I added this to the script:

$('html, body').animate({ scrollTop: 0 }, 0);

trazom’s picture

@neRok: This is a brilliant and elegant solution, thanks.

melandren’s picture

Add my ditto to getting this into the module. Would greatly help streamline the general look.

socceronly’s picture

I too am definitely hoping this is implemented.

bradallenfisher’s picture

I would love to see this feature.
for now you can add this into a .js file and insert it into your theme

$(function() {
  var accOpts = {
  active: false
  }	
  $(".quick-accordion").accordion(accOpts);
});
adrianodias’s picture

I would love to see this feature too!!

The following code solves the problem of accordion starts out opened then closes when loading a page.

$(document).ready(function() {
  jQuery.fx.off = true;
  setTimeout(function() { jQuery.fx.off=false;}, 1000);
  $(function() {
  var accordionOpt = {
  active: false
  }	
  $(".quick-accordion").accordion(accordionOpt);
});
});

btw: great module.

ultimateboy’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Active » Closed (duplicate)

This was solved over in #1023378: Ability to have no active tab/accordion item and is available as of the latest development release.