I think the best idea is to use a data-[type]
and compare it with an ID, class or other data-type. You can also do this with a class ofcourse.
Here is a fiddle. And here is the jQuery code:
$("div#links > a").hover(
function() {
var ID = $(this).data("content");
$("div#images").children("img#" + ID).fadeIn("slow");
},
function() {
var ID = $(this).data("content");
$("div#images").children("img#" + ID).stop(true).hide();
}
);
2
solved Make an Image(s) appear after hovering over an tag(s)