开发者

setting a div equivalent to Cartesian coordinates with (origin at left bottom

Here is my code

Here x,y coordinates start from the left top corner of "working-area" . but I want to set x, y coordinate at left bottom corner of that div.

please anyone help me? Thanks in 开发者_JAVA百科advance.


Here you go.

    var y = $(this).height() - (e.pageY - pos.top + 1);

The problem is that your #working_area and the GRID my be of same dimension with same alignment. But it seems that where you have implemented, the grid does not seem to fit, Therefore it would be best to give the working area the exact size of the grid.


Adding this to your code shoudl do the trick

    var height = $(this).height();
    var z = (pos.top + height) - e.pageY;

What it does is calculate the bottom based on th top plus the height, then subtract the position from that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜