I try to create a "page 'map'-overview" like this (or even more complex like this) however I stuck at the calculation, dont know where or how the problem can be eliminated.
Here's what I've done so far:
var Overview = (function() {
    $('.spot').each(function() {
        var el = $(this),
            map = $('#map'),
            point = document.createElement('span');
        point.className = 'point';
        map.append(point);
        var offsetX = el.offset().left, // Might the problem is here,
            offsetY = el.offset().top, // and here?!
            winW = $(window).width(),
            winH = $(window).height(),
            mapWidth = map.width() - $(point).width(),
            mapHeight = map.height() - $(point).height(),
            posX = offsetX / winW * mapWidth,
            posY = offsetY / winH * mapHeight;
        $(point).css({
            top: posY,
            left: posX
        });
    });
})();
I cant figure out, where the problem is. Any ideas how to fix or improve my calculations?
