Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Can this code be combined to be shorter?

$
0
0

Is it possible to combine these two so I don;t have to write it out for each fadeIn/fadeOut toggle?


// Set a toggle to hide or show an element

if (sym.getComposition().getStage().getSymbol("TIMELINE").$("RBS_timeline").is(":visible")) {

  sym.getComposition().getStage().getSymbol("TIMELINE").$("RBS_timeline").fadeOut();

} else {

  sym.getComposition().getStage().getSymbol("TIMELINE").$("RBS_timeline").fadeIn();

}

// insert code for mouse click here

 

 

// Set a toggle to hide or show an element

if (sym.getComposition().getStage().getSymbol("TIMELINE").$("apps1").is(":visible")) {

  sym.getComposition().getStage().getSymbol("TIMELINE").$("apps1").fadeOut();

} else {

  sym.getComposition().getStage().getSymbol("TIMELINE").$("apps1").fadeIn();

}


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>