Sto cercando di modificare un file js. questo gestisce l'apertura e la chiusura delle faq.
La struttura html è:
titolo
<div class="content">
<div style="float:right;">testo</div>
</div>
lo metto in tag php perchè non so se esiste il tag per js
Codice PHP:
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': activeBGColor, 'color': activeColor, 'border-bottom-color': activeBottomLineColor, 'padding-left': 6});
},
onBackground: function(tog){
tog.removeClass('selected');
var accTitleOnOff = new Fx.Styles(tog, {wait: false, duration: 350});
accTitleOnOff.start({ 'background-color': onBGColor, 'color': onColor, 'border-bottom-color': onBottomLineColor, 'padding-left': 0});
},
alwaysHide: true, duration: 500
} );
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': mouseOverBGColor, 'color': mouseOverColor, 'border-bottom-color': mouseOverBottomLineColor, 'padding-left': 6});}
},
'mouseout': function(){
if (!div.hasClass('selected')) { mouseFxs.start({ 'background-color': onBGColor, 'color': onColor, 'border-bottom-color': onBottomLineColor, 'padding-left': 0});}
}
}
);});
}
window.addEvent('domready', function(){ AccordionInit();});
il mio unico problema è che apre la prima voce automaticamente, allora ho modificato la riga
alwaysHide: true, duration: 500
in
alwaysHide: true, duration: 500, display: 1000, show: 1000
però così facendo non mi inizializza lo stile che deve avere ogni menuTitle. Come posso fare?
thanks.