Open In App

How to make Water Ripple Effect using jQuery ?

In this article we will learn about making water Ripple effects using jQuery, Ripples.js is a well-designed and compact jQuery plugin for producing stunning ripple effects. here we will use jQuery ripple.js.

Installation: Before moving further, firstly we have to add the water ripple CDN file to our project file:



https://cdnjs.cloudflare.com/ajax/libs/jquery.ripples/0.5.3/jquery.ripples.min.js

Approach: 



Example: In this example, we are using the above-explained approach.




<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta charset="utf-8">
    <script src=
    </script>
    <script src=
    </script>
</head>
 
<body>
    <div class="full-landing-image">
        <h1>GeeksForGeeks</h1>
    </div>
</body>
</html>

CSS Code:




body{
    margin: 0;
    padding: 0;
}
 
h1{
    text-align: center;
    color: blueviolet;
    padding-top: 300px;
}
 
.full-landing-image{
    width: 100%;
    height: 100vh;
    background-color: black;
    background-size: cover;
}

JavaScript Code:




<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta charset="utf-8">
 
    <script src=
        </script>
    <script src=
        </script>
     
    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
        }
 
        h1 {
            text-align: center;
            color: blueviolet;
            padding-top: 300px;
        }
 
        .full-landing-image {
            width: 100%;
            height: 100vh;
            background-color: black;
            background-size: cover;
        }
    </style>
</head>
 
<body>
    <div class="full-landing-image">
        <h1>GeeksForGeeks</h1>
    </div>
     
    <script type="text/javascript">
        $(".full-landing-image").ripples({
            resolution: 512,
            dropRadius: 20,
            interactive: true,
            perturbance: 0.02,
        });
    </script>
</body>
</html>

Output:


Article Tags :