To change the image on button click "Click here to change image with hover effect" with the current hover effect (using this library) without the hover effect, follow these steps. The example is hosted on my server because jsfiddle does not support WebGl.
View the Example
My code:
!function(f, l) { // Code here } })();
//# sourceMappingURL=hover-effect.umd.js.map
new hoverEffect({
parent: document.querySelector('.distortion'),
intensity: 0.3,
image1: 'https://tympanus.net/Development/DistortionHoverEffect/img/Img22.jpg',
image2: 'https://tympanus.net/Development/DistortionHoverEffect/img/Img21.jpg',
displacementImage: 'https://tympanus.net/Development/DistortionHoverEffect/img/displacement/8.jpg'
});
.landing {
display: flex;
justify-content: space-between;
height: 100vh;
}
.distortion {
width: 640px;
height: 920px;
align-self: flex-end;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/107/three.min.js"></script>
<div class="landing">
<div class="intro">
<h2>Lorem, ipsum.</h2>
<p>
<button>Click here to change image with hover effect</button>
</p>
</div>
<div class="distortion"></div>
</div>