Skip to content

Instantly share code, notes, and snippets.

@milushov
Last active December 18, 2015 04:29
Show Gist options
  • Save milushov/5725581 to your computer and use it in GitHub Desktop.
Save milushov/5725581 to your computer and use it in GitHub Desktop.
$(function(e) {
$('.map-place').click(function(e) {
var posX = $(this).offset().left;
var posY = $(this).offset().top;
res = "@include pos(TOPpx, LEFTpx)";
res = res.replace('TOP', (e.pageY - posY - 9).toFixed());
res = res.replace('LEFT', (e.pageX - posX - 9).toFixed());
console.log(res);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment