Support Forum

  • Page:
  • 1

[Solved] 1st FAQ preselected - how to deselect?

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

The first question of my Moo FAQ is pre-selected (highlighted & open)



How do de-select it so no questions are open when someone opens the page with the module?



Post edited by: jmaxpro, at: 2007/08/11 00:28<br><br>Post edited by: jmaxpro, at: 2007/08/11 00:29
  • Ricard's Avatar
  • Ricard
  • Free Extensions
  • 38 posts
  • Karma: 0
The administrator has disabled public write access.
Try replacing the code in the moo_faq.js file with this:



[code:1]// Defines the Accordion

function AccordionInit() {



var accTitle = $$('.menuTitle');

var accContent = $$('.content');

var pwAccordion = new Accordion(

accTitle, accContent, {



onActive: function(tog){

tog.addClass('selected');

var accTitleOnOff = new Fx.Styles(tog, {wait: false, duration: 350});

accTitleOnOff.start({

'background-color': '#9e3434',

'color': '#dce6b2',

'border-bottom-color': '#ea2020',

'padding-left': 6

});

},



onBackground: function(tog){

tog.removeClass('selected');

var accTitleOnOff = new Fx.Styles(tog, {wait: false, duration: 350});

accTitleOnOff.start({

'background-color': '#f2f2f2',

'color': '#2f3d31',

'border-bottom-color': '#ddd',

'padding-left': 0

});

},



alwaysHide: true,

duration: 500,

start: 'all-closed' //Makes accordion closed

}

);



// Mouse effects

accTitle.each(function(div) {

var mouseFxs = new Fx.Styles(div, {duration: 250, wait: false});

div.addEvents({

'mouseover': function(){

if (!div.hasClass('selected')) {

mouseFxs.start({

'background-color': '#CCCC99',

'color': '#9e3434',

'border-bottom-color': '#E5E5CC',

'padding-left': 6

});

}

},

'mouseout': function(){

if (!div.hasClass('selected')) {

mouseFxs.start({

'background-color': '#f2f2f2',

'color': '#2f3d31',

'border-bottom-color': '#ddd',

'padding-left': 0

});

}

}

});

});

}



window.addEvent('domready', function(){

AccordionInit();





});[/code:1]



The main thing you are looking for is this:

[code:1]start: 'all-closed' //Makes accordion closed

[/code:1]
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
That did it - thanks!



Post edited by: jmaxpro, at: 2007/08/06 03:28<br><br>Post edited by: jmaxpro, at: 2007/08/06 03:29
  • Ricard's Avatar
  • Ricard
  • Free Extensions
  • 38 posts
  • Karma: 0
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers