Efeito jQuery - Efeito Pulsado

Descrição

o Pulsateefeito pode ser usado com o método effect (). Isso pulsa a opacidade do elemento várias vezes.

Sintaxe

Aqui está a sintaxe simples para usar este efeito -

selector.effect( "pulsate", {arguments}, speed );

Parâmetros

Aqui está a descrição de todos os argumentos -

  • times- Vezes para pulsar. O padrão é 3.

  • mode- O modo do efeito. Pode ser "mostrar", "ocultar". O padrão é "show".

Exemplo

A seguir está um exemplo simples que mostra o uso deste efeito -

<html>
   <head>
      <title>The jQuery Example</title>
      <script type = "text/javascript" 
         src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
      </script>
		
      <script type = "text/javascript" 
         src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
      </script>
		
      <script type = "text/javascript" language = "javascript">
   
         $(document).ready(function() {

            $("#button").click(function(){
               $(".target").effect( "pulsate", {times:5}, 3000 );
            });
				
         });
			
      </script>
		
      <style>
         p {background-color:#bca; width:200px; border:1px solid green;}
         div{ width:100px; height:100px; background:red;}
      </style>
   </head>
	
   <body>
      <p>Click the button</p>
      <button id = "button"> Pulsate </button>

      <div class = "target">
      </div>
   </body>
</html>

Isso produzirá o seguinte resultado -

jquery-effects.htm