asp.net 上下移动功能
追问:<asp:/ id=" "></asp>不是js代码
追问:<asp:/ id=" "></asp>不是js代码
答案:你想用什么控件实现?比如说:datagridview吗?
其他:<html>
<head>
<script>
function moveUp()
{
document.getElementById("btnDown").disabled = false;
img = document.getElementById("img1");
img.style.top = parseInt(img.style.top,10)-30;
if(parseInt(img.style.top,10)<0)
{
img.style.top = 0;
event.srcElement.disabled = true;
}
}
function moveDown()
{
document.getElementById("btnUp").disabled = false;
img = document.getElementById("img1");
img.style.top = parseInt(img.style.top,10)+30;
if((parseInt(img.style.top,10)+img.height)>document.body.clientHeight)
{
img.style.top = document.body.clientHeight - img.height;
event.srcElement.disabled = true;
}
}
</script>
</head>
<body>
<img id="img1" style="position:absolute; top:100px; left:100px;" src="" />
<input id="btnUp" type="button" value="↑" onclick="moveUp()" />
<input id="btnDown" type="button" value="↓" onclick="moveDown()" />
</body>
</html>
上一个:用asp.net做网页,想在里面的某块地方加视频,怎么弄啊,哪位高手给说下。现在还不确定是什么格式的视频。
下一个:在asp.net中如何将数组中的元素在同一行输出?