We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7963
    • 67 Posts
    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
      • 7455
      • 2,204 Posts
      Nice work on this one.

      Would it be posible to have only 1 open at the same time, so when you select a new question the rest will be closed?

      greets Dimmy
        follow me on twitter: @dimmy01
        • 7963
        • 67 Posts
        Quote from: Dimmy at Mar 28, 2006, 12:50 AM

        Would it be posible to have only 1 open at the same time, so when you select a new question the rest will be closed?
        Okay I found it, just remove in the head tags (of the template) these line :

        myAccordion.showThisHideOpen = function(toShow){this.clearAndToggle(toShow);};
          • 32321
          • 29 Posts
          Quote from: Dragon at Mar 28, 2006, 12:35 AM

          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

          Add these code (in head part) in your template which will be used for FAQ sections, just add javascript and moofx effect :

          <head>
          <script src="manager/media/script/prototype.lite.js"></script>
          		<script src="manager/media/script/moo.fx.js"></script>
          		<script src="manager/media/script/moo.fx.pack.js"></script>
          	<script type="text/javascript">
          	//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: true, duration: 400}
          		);
          		myAccordion.showThisHideOpen = function(toShow){this.clearAndToggle(toShow);};
          
          		//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]);
          	}
          	</script>
          </head>
          


          Great thanks to L.Jégou (moderator on my board) wich made that great works. By default, it display the first answer

          Best Regards

          [EDIT] A quick preview : http://www.portailsig.org/faq/faq-mapinfo/gestion-des-objets-graphiques/item-manipulation-des-objets.html
          Sorry website is not finish but This is working smiley

          Hi,

          I got the snippet... created it, I did put the script in the head sections.... downloaded the .js files from the moo.fx site and uploaded them in the right directory...

          It’s not working.

          Can you actualy do some screenshots if you have time just to make sure i did all the things correctly.

          I hope u can help me ... I really like this snippet and it’s potential

          Cheers Whitehat
            • 7963
            • 67 Posts
            Hi,

            sorry for late, i forget to precise, you have to paste this code at the end of the template file juste before </body></html>

            	
                    <script type="text/javascript">
            		//Element.cleanWhitespace('content');
            		init();
            	</script>
            


            Regards
              • 7455
              • 2,204 Posts
              mm the demo url is not working right in IE it closes but directly opens again when clicking links
                follow me on twitter: @dimmy01
                • 7963
                • 67 Posts
                Quote from: Dimmy at Jun 29, 2006, 06:46 AM

                mm the demo url is not working right in IE it closes but directly opens again when clicking links

                Yes you’re right, in fact in my old template it was working, but in this one, it doesnt’ work properly, seems to have difficult to work with xhtml transitionnal instead of xhtml strict ... Bug is posted a lot of time in moofx forum, cause we are not alone to see this bug, but no answer at this time .... Continue to search sad
                  • 20761
                  • 27 Posts
                  i included everything like it should be, but it just does not fold out?

                  what could that be?

                  the error is:

                  Fehler: this.fxa[i] has no properties
                  Quelldatei: http://chamaeleons-online.com/manager/media/script/moo.fx.pack.js
                  Zeile: 140

                  and
                  Fehler: element has no properties
                  Quelldatei: http://chamaeleons-online.com/manager/media/script/prototype.lite.js
                  Zeile: 96

                  does anyone know what this means?
                    • 7923
                    • 4,213 Posts
                    Quote from: Dragon at Jul 06, 2006, 03:25 PM

                    Nb to moderator, shoul I update first message with all of that ? Could you do it, if you think it’s better ?
                    Newest code should allways definitely be in first post of the thread.. just edit your post and replace the old code with this. But is this snippet/package in the resource repository? All new (and old) resources should be added there. In future, you don’t need to paste/attach code to the forums, just link to your repository item.

                    Great work btw with this snippet!


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 7963
                      • 67 Posts
                      Ok First Post edition Ok. Thanks for your advice

                      Anyway move it to repository should be difficult cause there is a lot of part of code wich has to be in the template ... sad