HomeLanguagesJavascriptscript.aculo.us Pulsate Effect

script.aculo.us Pulsate Effect

In this article we will demonstrate the effect of Pulsate by using JavaScript library called script.aculo.us having smooth transition from one to another. We can adjust the duration of the effect as well.

Syntax:

Effect.Pulsate('id_of_element');
Effect.Pulsate('id_of_element', { pulses: 5, duration: 1.5 });

Note: To use this library we are suppose to download or install the library and then use it in our programs. And to do so you can follow the this link http://script.aculo.us/downloads.

Approach:

To demonstrate the use of this function we have written a small piece of code. In which we have written a small JavaScript function named ShowEffect() method which uses Pulsate() method of this library. By clicking on Click Image to Pulsate, you will see the effect clearly.

Example: To see the effect first install the library and then open the following program in local environment.

HTML




    <html>
   <head>    
  
      <script type = "text/javascript" 
       src="scriptaculous-js-1.9.0/lib/prototype.js">
      </script>
      <script type = "text/javascript" 
       src="scriptaculous-js-1.9.0/src/scriptaculous.js?load = effects">
      </script>
          
      <script type = "text/javascript">
        
           function ShowEffect(element){
            new Effect.Pulsate(element, { duration: 3.0 });
         }          
      </script>
   </head>
     
   <body>
        <h2>Pulsate Effect for Image</h2>                 
    <div id="hideshow" onclick = "ShowEffect(this);">
             <img src = "GEEKSIMAGES/neveropen1.PNG" alt = "" /><br/>
         Click Image to Pulsate
    </div>
   </body>
</html>
     


Output:

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

4 COMMENTS

Most Popular

Dominic
32729 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7111 POSTS0 COMMENTS
Nicole Veronica
12248 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12331 POSTS0 COMMENTS
Shaida Kate Naidoo
7225 POSTS0 COMMENTS
Ted Musemwa
7482 POSTS0 COMMENTS
Thapelo Manthata
7204 POSTS0 COMMENTS
Umr Jansen
7177 POSTS0 COMMENTS