Change markers opacity

I am using mapbox-gl library
there is target list when we click on single target jo main location indicator marker should be remain same other become transparent how can we acheive this and when we go back to list all marker should come in there default opacity or solid color

please help me