if pageX point pageY point var offset window eq offset var topoff wind

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if (e.pageX > point[0] && e.pageY > point[1]) {
var offset = $(".window").eq(1).offset();
var topoff = $(".window").eq(1).find(".title").height() + $(".window").eq(1).find(".panel").height() + offset.top + 22;
selbox.css({
top: point[1] - topoff,
left: point[0] - offset.left,
width: (e.pageX - point[0]),
height: (e.pageY - point[1])
});
} else if (e.pageX < point[0] && e.pageY < point[1]) {
var offset = $(".window").eq(1).offset();
var topoff = $(".window").eq(1).find(".title").height() + $(".window").eq(1).find(".panel").height() + offset.top + 22;
selbox.css({
left: (e.pageX - offset.left),
top: (e.pageY - topoff),
width: point[0] - e.pageX,
height: point[1] - e.pageY
});
} else if (e.pageX > point[0] && e.pageY < point[1]) {
var offset = $(".window").eq(1).offset();
var topoff = $(".window").eq(1).find(".title").height() + $(".window").eq(1).find(".panel").height() + offset.top + 22;
selbox.css({
left: point[0] - offset.left,
top: (e.pageY - topoff),
width: e.pageX - point[0],
height: point[1] - e.pageY
});
} else if (e.pageX < point[0] && e.pageY > point[1]) {
var offset = $(".window").eq(1).offset();
var topoff = $(".window").eq(1).find(".title").height() + $(".window").eq(1).find(".panel").height() + offset.top + 22;
selbox.css({
left: (e.pageX - offset.left),
top: (point[1] - topoff),
width: point[0] - e.pageX,
height: e.pageY - point[1]
});
}