I have a directory map in SVG format containing around 30-40 listings. I have assigned classes to each location within the map.
Now comes the challenging part,
The objective is to create a tooltip hover effect for each listing that displays the business name and when clicked, directs you to the corresponding page.
While I could individually write jQuery code for each listing, there must be a more efficient way than creating 30 separate click rules and 30 additional hover effects.
Edit: Here is how it currently looks:
$(".location-m1").hover(function(){
$(".directory-m1").css("display", "block");
$(".location-m1").css("opacity", ".7");
}, function(){
$(".directory-m1").css("display", "none");
$(".location-m1").css("opacity", "1");
});