When you apply the Opacity you set the value for the current Layer only.
Usage
var opacity = "80.000000"; Opacity()
Example
//1. we define the opacity variable to 80%, the 6 number after the coma are important. var opacity = "80.000000"; //2. Call the function to apply the value. Opacity()