sirxemic / jquery.ripples

Add a water ripple effect to your background using WebGL.
https://sirxemic.github.io/jquery.ripples/
MIT License
1.06k stars 416 forks source link

New coder here! Need Help #68

Closed shreyaspaul closed 3 years ago

shreyaspaul commented 4 years ago

Hey OP. Loved your plugin and I'd like to integrate it into my future projects too!

The problem I'm facing is: I can't seem to get the plugin running on a very simple html page.

Here is what I've done to my code:

  1. Added Jquery via google cdn.
  2. added a bg image to the body.
  3. Added the code linking to the js file.
  4. tried to initialize the plugin using the code you've mentioned.

The effect just does not come into effect.

It'd be great if you could help me learn this!

I'm adding my html file too.

index.txt

sirxemic commented 3 years ago

I'm sure you've figured it out by now, but you were missing some initialization code:

$('body').ripples({
    resolution: 512,
    dropRadius: 20,
    perturbance: 0.04,
});