87,910
社区成员
发帖
与我相关
我的任务
分享
function moveline(){
var box_width=80;
var box_top=60;
var current_cursor_x=event.clientX;
var current_cursor_y=event.clientY;
var line_in=current_cursor_x-div_left;
var top_in=current_cursor_y-div_top;
if(line_in>=left_blank&&line_in<=(width-right_blank)){//控制边界
//线跟随
line1.style.left=line_in-left_blank;
//框跟随
var x_value_temp=cal_x(line_in);
var x_index=get_x_index(x_value_temp);
msg_box.innerHTML="<p><font size=2> "+find_x(x_index)+"</font><br><font size=2 color='blue'> "+find_y(x_index)+"</font>";
if(line_in<width-right_blank-box_width-10){
msg_box.style.left=line_in+5;
}else{
msg_box.style.left=line_in-box_width;
}
if(top_in>=top_blank&&top_in<=(height-bottom_blank)){
if(top_in<=height-bottom_blank-box_top-10){
msg_box.style.top=top_in;
}else{
msg_box.style.top=top_in-box_top;
}
}
}
}