i have drags function to drag a lensflare icon on panorama image to find lensflare coordinates.
how to find lensflare coordinates ath and atv with jquery?
Code
<div id="panoramaimagecontainer" style="width:800px; height:600px; border:1px solid #e2e2e2;">
<img class="lenflareimg" src="iconpath/lensflareicon.jpg" width="16" height="16" /><!--dragable icon-->
<img class="panoramaimage" src="path/panoramaimage.jpg" style="width:100%; height:100%; "/><!--panorama image-->
</div>
<script>
function drag(){.....}
// lensflare dragaable
$(document).on('mousemove','.lenflareimg',function(e){
$(this).drags();
var offset = $('.panoramaimage').offset();
h=e.clientX - offset.left;
v=e.clientY - offset.top
var x = (h + 180)/360 * 800; //image size width=800px orjinal is 4096 px
var y = (v + 90)/180 * 600; //imagesize height=600 orjinal is 2048
// set this params to input areas
$('.ath').val(x)
$('.atv').val(y)
});
</script>
Display More