鼠标移动层
.box
{
position: fixed;
top: 180px;
right: 300px;
width: 230px;
height: 600px;
background: #EEE;
cursor: move;
}
<div id="drag" class="box">
<div id="carbonads-container">
<div class="carbonad">
<div id="azcarbon">
</div>
<table width="185px" style="float:left">
<tr>
<td style="padding-left: 10px;">
题号
</td>
<td style="padding-left: 20px;">
选项
</td>
</tr>
<%for (int i = 1; i <= 20; i++)
{ %>
<tr>
<td style="padding-left: 10px;">
<%=i %>
</td>
<td style="padding-left: 20px;">
<input type="radio" name="radioTopic<%=i %>" value="A" value1="<%=i %>" />A<input
type="radio" name="radioTopic<%=i %>" value="B" value1="<%=i %>" />B<input type="radio"
name="radioTopic<%=i %>" value="C" value1="<%=i %>" />C<input type="radio" name="radioTopic<%=i %>"
value="D" value1="<%=i %>" />D
</td>
</tr>
<%} %>
<tr>
<td colspan="2" height="10xp;">
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input style="width: 130px" type="button" id="imgtijiao" value="提 交" /><br />
</td>
</tr>
</table>
<div style="width:40; float:right"><input style="width:30px;height:200px; cursor:pointer" type="button" id="bt1" value="按 住 我 拖 动 框" /></div>
</div>
</div>
</div>
$(document).ready(function (e) {
$("#bt1").mousedown(function (e) {
iDiffX = e.pageX - $(".box").offset().left;
iDiffY = e.pageY - $(".box").offset().top;
$(document).mousemove(function (e) {
$(".box").css({ "left": (e.pageX - iDiffX), "top": (e.pageY - iDiffY) });
});
});
$("#bt1").mouseup(function () {
$(document).unbind("mousemove");
});
});