I am currently working on enhancing a Squarespace website by adding a new image fade-in/fade-out effect when the mouse hovers over one of three buttons. The challenge I'm facing is that the main static image is embedded as an img element in the HTML rather than in the CSS, making it difficult to change it directly. I attempted to modify the element.src using JavaScript, but unfortunately, there was no transition effect. Would it be advisable to introduce another element into the JavaScript code to achieve the desired image transition with opacity? However, this seems like additional work especially when operating within the constraints of Squarespace.
Any advice or suggestions on how to approach this issue would be greatly appreciated. Additionally, I have included a snippet displaying my current code and highlighting the problem at hand.
Just a note - the buttons are currently positioned beneath the image and do not require any adjustments to their placement.