The user will be able to click on 3 points on the image, and I want to display the BLACK point at these points. Then I will save these values in my database and regenerate the image with these 3 points later.
This is a two-part question:
1.) In my code, I cannot detect the onClick event when the image is clicked. Maybe someone will learn it. Here is my code. JSFIDDLE
$(document).ready(function () {
$('body').click(function (ev) {
alert("d");
mouseX = ev.pageX;
mouseY = ev.pageY
alert(mouseX + ' ' + mouseY);
var color = '#000000';
var size = '1px';
$("body").append(
$('<div></div>')
.css('position', 'absolute')
.css('top', mouseY + 'px')
.css('left', mouseX + 'px')
.css('width', size)
.css('height', size)
.css('background-color', color));
});
});
HTML
<body background="http://www.craigjoneswildlifephotography.co.uk/blog/wp-content/uploads/2010/07/CMJ57311.jpg">
</body>
2.) Tell me that I have the X and Y coordinates of the points and how can I restore the image with these points?
Illep source
share