Is it possible to show an image via mouseover on a link whose only matching tags are title and alt?
My CMS can only generate matching title and alt tags for 2 completely seperated elements. It roughly looks like this:
<a href="#" title="aubergine">hover this to show image</a>
<img width="300" height="300" alt="aubergine" src="http://i.imgur.com/0MmkDiI.jpg"></img>
I've been able to target the img like so:
$('a').mouseover(function() {
$('[alt="aubergine"]').css( "opacity", "100" );
});
But instead of the specific target [alt="aubergine"]
i would have to get the image via [alt="title of this link i just hovered"]
.
Here is a fiddle with the working prototype so far: https://jsfiddle.net/82xnqu6j/1/