Real beginners question and apologies about the crude art in the link, but I'm struggling to articulate without it. Also, as a new poster, I'm limited to two hyperlinks per-question, so apologies for not linking the code I've used below.
I have an image to place trigger points on. After clicking on the trigger, a table would ideally appear. For example, if I click on the roof, I would like a table saying the roof is blue, or the door one saying it's red.
I've been playing around with each of these, but haven't had any success yet.
HTML Image Maps
<!DOCTYPE html>
<html>
<body>
<p>Click on the sun or on one of the planets to watch it closer:</p>
<img src="https://www.w3schools.com/tags/planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
</body>
</html>
CSS Left/Right Properties
<!DOCTYPE html>
<html>
<head>
<style>
div.relative {
position: relative;
width: 400px;
height: 200px;
border: 3px solid #8AC007;
}
div.absolute {
position: absolute;
right: 20px;
width: 200px;
height: 120px;
border: 3px solid #8AC007;
}
</style>
</head>
<body>
<div class="relative">This div element has position: relative;
<div class="absolute">This div element has position: absolute. It is placed 20 pixels to the left of the right edge of the containing positioned element (div with class="relative").</div>
</div>
</body>
</html>
JQuery
$(function() {
$("#test").click(function(e) {
var offset = $(this).offset();
var relativeX = (e.pageX - offset.left);
var relativeY = (e.pageY - offset.top);
alert(relativeX+':'+relativeY);
$(".position").val("afaf");
});
});
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<div class="position">Hello</div><br/><br/>
<div >
<div>
<div>
<a id="test">
<img class="demo-box" src="http://www.degordian.com/static/img/shareImg/degordian.png" />
</a>
</div>
</div>
</div>
<br/><br/>Hello again<br/><br/>
<div >
<img class="demo-box" src="http://www.degordian.com/static/img/shareImg/degordian.png" />
</div>
Kind of stuck on where to start, so any pointers in the right direction would be much appreciated. This is what the image would originnally looks like and this is how it should be rendered.