Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
Flashing the <button> background color

I am trying to make animation work: Basically there's a drop down box and a button When a user makes new selection of the drop down, the button background color will change accordingly. This part works. However, I'd like to add an animation effect that whenever a new selection is made in drop down, the background color of the color will change accordingly and flash for 3 times. The reason is that this animation will show that new selection is accepted and handled.

I'm using Angular type script.

Here's the drop down list for user to select an option

<mat-select>
    <mat-option (onSelectionChange)="setButtonColor($event)" *ngFor="let opt of Opts" [value]="Opts">
      {{ opt }}
    </mat-option>
  </mat-select>

Here's how button is created in the html

<button mat-raised-button class="mt-status-button"
        [ngStyle]="{'background-color': bgColor[0], 'color': 'white', 'width': '120px', 'margin': '10px 5px 5px 50px'}">
  item1
</button>

Here's the setButtonColor triggered by new option selection and it will change the backcolor of the button (changing the values of bgColor[0]) and hopefully the newly changed background color will flash

Right now the color change is successfully but I cannot make it flash upon selection of the drop down list.

  setButtonColor(event) {
    if (event.isUserInput) {
        var colorStr:string;
        <==== Is there a way to trigger button background color flash for 3 times in here?
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda