Hi,
This is the snippet NeatFAQ modifiy for my website. It display FAQ as NeatFAQ but include special moofx effect like on :
http://moofx.mad4milk.net/
We delete some function that I doesn’t need like character limitation in anwser and the checkbox wich display all answer.
Name : NeatFAQMoo
yes we have same problem...
This is due to error of moofx.js ... They’re was a mistake in there file. So re-download the moofx script on the official website and overwrite it ...
This is last version of the snippet in attachment
here is the code between head tag in the template :
//the main function, call to the effect object
function init(){
var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
var toggles = document.getElementsByClassName('question'); //questions where I click on
//accordion effect
var myAccordion = new fx.Accordion(
toggles, stretchers, {opacity: false}
);
//myAccordion.showThisHideOpen = function(toShow){this.clearAndToggle(toShow);};
myAccordion.showThisHideOpen = function(toShow){
this.elements.each(function(el, j){
if (el == toShow) this.clearAndToggle(toShow, j);
}.bind(this));
}
//hash functions
var found = false;
toggles.each(function(h3, i){
var div = Element.find(h3, 'nextSibling'); //element.find is located in prototype.lite
if (window.location.href.indexOf(h3.title) > 0) {
myAccordion.showThisHideOpen(div);
found = true;
}
});
if (!found) myAccordion.showThisHideOpen(stretchers[0]);
}
function openAll() {
var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
var toggles = document.getElementsByClassName('question'); //questions where I click on
//accordion effect
var myAccordion = new fx.Accordion(
toggles, stretchers, {opacity: false}
);
//myAccordion.showThisHideOpen = function(toShow){this.clearAndToggle(toShow);};
myAccordion.showThisHideOpen = function(toShow){
this.elements.each(function(el, j){
if (el == toShow) this.clearAndToggle(toShow, j);
}.bind(this));
}
toggles.each( function(h3,i) {
myAccordion.showThisHideOpen(stretchers[i]);
});
}
function closeAll() {
var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
var toggles = document.getElementsByClassName('question'); //questions where I click on
//accordion effect
var myAccordion = new fx.Accordion(
toggles, stretchers, {opacity: false}
);
myAccordion.showThisHideOpen = function(toShow){this.clearAndToggle(toShow);};
toggles.each( function(h3,i) {
myAccordion.showThisHideOpen(stretchers[i]);
});
}
</script>
New function to open all question or close all can be paste in the body where you want :
<a href="javascript:openAll();">Ouvrir toutes les questions</a> / <a href="javascript:closeAll();">Fermer toutes les questions</a>
And don’t forget at the end, juste before the </body> tag :
<script type="text/javascript">
//Element.cleanWhitespace('content');
init();
</script>
Enjoy the demo on
http://www.portailsig.org/faq/faq-esri/vecteur/item-creation-mise-jour-entites.html