<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> </title>
<Style type = "text/CSS">
TD
{
Border: solid 1px #185d98;
Width: 60px;
Text-align: center;
Padding: 8px;
}
</Style>
<SCRIPT type = "text/JavaScript" src = ".../JS/jquery-1.3.2.min.js"> </SCRIPT>
</Head>
<Body style = "text-align: center; margin: 5px auto;">
<Form ID = "form1" runat = "server">
<Div style = "margin: 5px auto; width: 100%; Border: solid 1px # f7d1a5; text-align: center;">
<Table id = "mytable" cellpadding = "0" cellspacing = "0">
</Table>
<Div style = "width: 200px; Height: 80px; position: absolute; Background-color: # db0c0c"
Id = "mydiv">
& Nbsp;
</Div>
<SCRIPT type = "text/JavaScript">
$ (Function (){
VaR table = $ ("# mytable ");
For (VAR I = 0; I <200; I ++ ){
Table. append ("<tr> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD>" + I * 10 + "</TD> <TD> "+ (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 2) + "</TD> <TD>" + (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 1) + "</TD> <TD>" + (I * 10 + 1) + "</TD> </tr> ");
}
VaR mydiv =$ ("# mydiv ");
Table. Find ("tr> TD"). Click (function (e ){
VaR x = document.doc umentelement. scrollleft + E. clientx;
Var y = document.doc umentelement. scrolltop + E. clienty;
VaR width = document.doc umentelement. clientwidth;
VaR Height = document.doc umentelement. clientheight;
// Var width = document.doc umentelement. scrollwidth;
// Var Height = document.doc umentelement. scrollheight;
VaR divwidth = mydiv. ATTR ("offsetwidth ");
VaR divheight = mydiv. ATTR ("offsetheight ");
If (x + divwidth> width ){
X = x-divwidth;
}
If (Y + divheight> height ){
Y = Y-divheight;
}
Mydiv.css ("Left", (x + "PX" )).css ("TOP", (Y + "PX "));
});
});
</SCRIPT>
</Div>
</Form>
</Body>
</Html>