I have a hover list box with links that, when visited, change the main image of the list box to a relevant image. However, I am using a lazy load plugin and want to change the image source using data-src
instead of src
. Unfortunately, it is not working as expected. How can I dynamically handle this?
Another thing I believe is possible but I'm not sure how to achieve it... When I leave the area, the images should revert to default, but I haven't been able to make it work.
This is my main structure:
HTML
<div class="tur-list-box">
<!-- content here -->
</div>
and JS
// JavaScript code here
// More code...
If you hover over the image, you will see links that, when clicked, change the images. Click here to see the demo