Hi, I was hoping someone could help me. I noticed that there is a little bit more possibility of doing this with MooFX but it hasn''t been revealed yet. I enjoy script.aculo.us and would like to find out how to do it; I''d like to open an element and close it as you click on the other. <div id="example"> <span class="test">MENU ITEM 1</span> </div> <div id="example2"> <span class="test">MENU ITEM 2</span> </div> In other words for better understanding what I am trying to do, when you click on "MENU ITEM 1" it uses blinds-down and blinds-up to open a hidden element. What extra code would I add to my combo if I wanted to have "MENU ITEM 1" close using blinds-up when clicked on "MENU ITEM 2" and than when MENU ITEM 1 window or element is closed open MENU ITEM 2 element ??? This is what I got right now in my combo; Effect.OpenUp = function(element) { element = $(element); new Effect.BlindDown(element, arguments[1] || {}); } Effect.CloseDown = function(element) { element = $(element); new Effect.BlindUp(element, arguments[1] || {}); } Effect.Combo = function(element) { element = $(element); if(element.style.display == ''none'') { new Effect.OpenUp(element, arguments[1] || {}); }else { new Effect.CloseDown(element, arguments[1] || {}); } } Any help will of course help :) Thank you in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It sounds like you need an accordion effect, I made one a while back & have attached it. Please let me know if you have any problems with it. Ian>Hi, > >I was hoping someone could help me. I noticed that there is a little >bit more possibility of doing this with MooFX but it hasn''t been >revealed yet. I enjoy script.aculo.us and would like to find out how to >do it; > >I''d like to open an element and close it as you click on the other. > ><div id="example"> > <span class="test">MENU ITEM 1</span> ></div> ><div id="example2"> > <span class="test">MENU ITEM 2</span> ></div> > >In other words for better understanding what I am trying to do, when >you click on "MENU ITEM 1" it uses blinds-down and blinds-up to open a >hidden element. What extra code would I add to my combo if I wanted to >have "MENU ITEM 1" close using blinds-up when clicked on "MENU ITEM 2" >and than when MENU ITEM 1 window or element is closed open MENU ITEM 2 >element ??? > >This is what I got right now in my combo; > >Effect.OpenUp = function(element) { > element = $(element); > new Effect.BlindDown(element, arguments[1] || {}); >} > >Effect.CloseDown = function(element) { > element = $(element); > new Effect.BlindUp(element, arguments[1] || {}); >} > >Effect.Combo = function(element) { > element = $(element); > if(element.style.display == ''none'') { > new Effect.OpenUp(element, arguments[1] || {}); > }else { > new Effect.CloseDown(element, arguments[1] || {}); > } >} > >Any help will of course help :) Thank you in advance. > > >> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Ian, It''s not the accordion effect, well actually it might be for all i know, not a javascript expert. :) thanks for your message. I will review the accordion effect but I dont think it will help much... My menu is horizontal, and I''m trying to open hidden div''s by clicking on ITEM 1 or ITEM 2... but using the OpenDown and CloseDown effect it just opens and closes them one by one... if you click on ITEM1 and ITEM 2 it will open the hidden div''s beneath each other one by one... It might be an accordion effect... :) any other suggestions are welcome.. maybe its something totally new we gotta come up with. :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Ian, It''s not the accordion effect, well actually it might be for all i know, not a javascript expert. :) thanks for your message. I will review the accordion effect but I dont think it will help much... My menu is horizontal, and I''m trying to open hidden div''s by clicking on ITEM 1 or ITEM 2... but using the OpenDown and CloseDown effect it just opens and closes them one by one... if you click on ITEM1 and ITEM 2 it will open the hidden div''s beneath each other one by one... It might be an accordion effect... :) any other suggestions are welcome.. maybe its something totally new we gotta come up with. :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Everyone, I actually found I guess a quick fix for this now, I added an extra "onClick" to the span''s ... something like; <span class="testing" onClick="new Effect.BlindUp(''test'')" ><a href="javascript:Effect.Combo(''test'', {duration: .5});"></a></span> that will do it, now one question.... one things I don''t seem to figure out, is it possible to have multiple elements ? example onClick="new Effect.BlindUp(''test1'',''test2'',''test3'')" or onClick="new Effect.BlindUp(''test1,test2,test3'')" The above doesn''t work for me, using a single element does, could someone suggest code line with multiple elements to close as selected in () ? Thank you in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Not tested, but... [''test1'',''test2'',''test3''].each(function(el){ new Effect.BlindUp(el); }); Should do it. -Jerod On 11/24/06, Catbones <arturb-1KbuuAuXJEEN+BqQ9rBEUg@public.gmane.org> wrote:> > > Hi Everyone, > > I actually found I guess a quick fix for this now, I added an extra > "onClick" to the span''s ... something like; > > <span class="testing" onClick="new Effect.BlindUp(''test'')" ><a > href="javascript:Effect.Combo(''test'', {duration: .5});"></a></span> > > that will do it, > > now one question.... one things I don''t seem to figure out, is it > possible to have multiple elements ? > > example onClick="new Effect.BlindUp(''test1'',''test2'',''test3'')" or > onClick="new Effect.BlindUp(''test1,test2,test3'')" > > The above doesn''t work for me, using a single element does, could > someone suggest code line with multiple elements to close as selected > in () ? > > Thank you in advance. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---