-
1. Re: Pls help! is there a simpler way to list this code?
resdesign May 14, 2014 11:10 AM (in response to jamesfootight)Try to give them a class name (pieChart and finalPieChart). You can add the class in edge or in code.
sym.$(".pieChart").slideToggle();
sym.$(".finalPieChart").fadeOut();
-
2. Re: Pls help! is there a simpler way to list this code?
jamesfootight May 14, 2014 11:33 AM (in response to resdesign)I tried to condense:
sym.$("UKstandardbuttons").fadeToggle();
sym.$("AUSstandardbuttons").fadeOut();
sym.$("Hongkongstandardbuttons").fadeOut();
sym.$("Switzerlandstandardbuttons").fadeOut();
sym.$("Irelandstandardbuttons").fadeOut();
sym.$("Indiastandardbuttons").fadeOut();
sym.$("Japanstandardbuttons").fadeOut();
sym.$("Netherlandsstandardbuttons").fadeOut();
sym.$("Spainstandardbuttons").fadeOut();
into:
var UKfinalstandardbuttons = {'UKstandardbuttons','AUSstandardbuttons','Hongkongstandardbuttons'...etc}
but it wouldn't work? any thoughts
-
3. Re: Pls help! is there a simpler way to list this code?
jamesfootight May 14, 2014 11:36 AM (in response to jamesfootight)is class better than var in this instance?
-
4. Re: Pls help! is there a simpler way to list this code?
joel_pau May 14, 2014 12:27 PM (in response to jamesfootight)You can try:
UKfinalstandardbuttons = [ 'UKstandardbuttons’, 'AUSstandardbuttons’, ’Hongkongstandardbuttons’, ...etc ]
$.each( UKfinalstandardbuttons, function(index, value) { sym.$(value).fadeOut() } );
With text:
hiding = [ "days", "hours", "minutes", "seconds" ];
$.each(hiding, function(index, value) { sym.$(value).html("") } );
-
5. Re: Pls help! is there a simpler way to list this code?
jamesfootight May 14, 2014 12:59 PM (in response to joel_pau)Hi, thanks, so sorry for being dumb, but where you say "with text", where and what bit would that be in adobe edge? I don't quite understand the 'hiding' part too?
I see where you have the fade out for all the 'standardbuttons' except the UK one (which is fadetoggle) so would the full code be:
UKfinalstandardbuttons = [ 'UKstandardbuttons’, 'AUSstandardbuttons’, ’Hongkongstandardbuttons’, ...etc ]
$.each( UKfinalstandardbuttons, function(index, value) { sym.$(value).fadeOut() } );
in 'creationcomplete' and then in actions for the button to call the actions:
sym.$("UKstandardbuttons").fadeToggle();
in my original project, the code above is in an action for an element??
-
6. Re: Pls help! is there a simpler way to list this code?
joel_pau May 14, 2014 1:15 PM (in response to jamesfootight) -
7. Re: Pls help! is there a simpler way to list this code?
jamesfootight May 14, 2014 1:23 PM (in response to joel_pau)thanks, but i think that's a bit to complex for me, at this stage I just need to know how to condense writing something like:
sym.$("UKstandardbuttons").fadeToggle();
sym.$("AUSstandardbuttons").fadeOut();
sym.$("Hongkongstandardbuttons").fadeOut();
sym.$("Switzerlandstandardbuttons").fadeOut();
sym.$("Irelandstandardbuttons").fadeOut();
sym.$("Indiastandardbuttons").fadeOut();
sym.$("Japanstandardbuttons").fadeOut();
sym.$("Netherlandsstandardbuttons").fadeOut();
sym.$("Spainstandardbuttons").fadeOut();
into a var or class?
as i don't want to have to repeat the above code within each elements action (with the fadeToggle swapping for each elements action etc)
thanks
-
8. Re: Pls help! is there a simpler way to list this code?
resdesign May 14, 2014 1:25 PM (in response to jamesfootight)James, do you not like the class idea?
If you give your elements a class name then you can use only 2 lines.



