[solved] 1.11 to 1.2 accordion Migration

here you will find only solved Help topics

Moderator: 1.2 Moderators

[solved] 1.11 to 1.2 accordion Migration

Postby Ivan on Tue Mar 09, 2010 6:20 pm

Problem to convert it to mootools 1.2

"1.11 to 1.2 Migration Guide" don't help me

http://www.solutoire.com/experiments/mo ... c_ex3.html

  1. var accordion;
  2. var accordionTogglers;
  3. var accordionContents;
  4.  
  5. window.onload = function() {
  6.  
  7. accordionTogglers = document.getElementsByClassName('accToggler');
  8.  
  9. accordionTogglers.each(function(toggler){
  10. //remember the original color
  11. toggler.origColor = toggler.getStyle('background-color');
  12. //set the effect
  13. toggler.fx = new Fx.Color(toggler, 'background-color');
  14. });
  15.  
  16. accordionContents = document.getElementsByClassName('accContent');
  17.  
  18. accordion = new Fx.Accordion(accordionTogglers,
  19. accordionContents,{
  20. //when an element is opened change the
  21. //background color to blue
  22. onActive: function(toggler){
  23. toggler.fx.toColor('#6899CE');
  24. },
  25. onBackground: function(toggler){
  26. //change the background color to the original (green)
  27. //color when another toggler is pressed
  28. toggler.setStyle('background-color', toggler.origColor);
  29. }
  30. });
  31. }
Last edited by Ivan on Fri Mar 12, 2010 6:29 pm, edited 1 time in total.
Ivan
 
Posts: 8
Joined: Sat May 16, 2009 1:50 pm

Re: 1.11 to 1.2 accordion Migration

Postby daKmoR on Wed Mar 10, 2010 1:00 pm

this is a little simplified version of it
http://jsfiddle.net/tKdxr/
"Speak when you are angry and you will make the best speech you will ever regret." - Ambrose Bierce
User avatar
daKmoR
Site Admin
 
Posts: 860
Joined: Mon Jul 14, 2008 11:40 am

Re: 1.11 to 1.2 accordion Migration

Postby Ivan on Fri Mar 12, 2010 6:28 pm

Thank you! :-)
Ivan
 
Posts: 8
Joined: Sat May 16, 2009 1:50 pm


Return to Solutions

Who is online

Users browsing this forum: No registered users and 4 guests

cron