| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 492 人关注过本帖
标题:为什么向左移动不了?
只看楼主 加入收藏
发光
Rank: 1
来 自:广西
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-11-29
结帖率:0
收藏
已结贴  问题点数:20 回复次数:3 
为什么向左移动不了?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function upmove()
{
    var startTop=document.getElementById("zfg").style.posTop;
    document.getElementById("zfg").style.posTop=startTop-10;
}
function downmove()
{
    var startTop1=document.getElementById("zfg").style.posTop;
    document.getElementById("zfg").style.posTop=startTop1+10;
}
function rightmove()
{
    var startTop2=document.getElementById("zfg").style.posLeft;
    document.getElementById("zfg").style.posLeft=startTop2+10;
}
function leftmove()
{
    var startTop3=document.getElementById("zfg").style.posLeft;
    document.getElementById("zfg").style.posLeft=startTop3-10;
}
function hidemove()
{
    var pic=document.getElementById("zfg");
  pic.style.display="none";
}
function showmove()
{
    var pic=document.getElementById("zfg");
    pic.style.display="block";
}
</script>
<style type="text/css">
#css {
    background-color: #999;
    height: 180px;
    width: 200px;
    position: absolute;
    left: 147px;
    top: 80px;
}
-->
</style>

</head>

<body>
<input name="rightmove" type="button" value="向右移动10pt" onclick="rightmove()">
<input name="leftmove" type="button" value="向左移动10pt" onclick="leftmove">
<input name="upmove" type="button" value="上移10pt" onclick="upmove()">
<input name="downmove" type="button" value="下移10pt" onclick="downmove()">
<input name="hidemove" type="button" value="隐藏" onclick="hidemove()">
<input name="showmove" type="button" value="显示" onclick="showmove()">
<FORM> <INPUT TYPE='BUTTON' value='关闭' onClick='window.close()'> </FORM>
<div id="zfg" style="background-color: #999;height: 180px;width: 200px;position: absolute;left: 147px;top: 80px;">可单击上面按钮进行操作</div>
 
</body>
</html>
搜索更多相关主题的帖子: html javascript function PUBLIC title 
2010-12-06 10:36
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:10 
onclick="leftmove">问题是你的点击事件调用方法的时候 少了()应该是
<input name="leftmove" type="button" value="向左移动10pt" onclick="leftmove()">
2010-12-06 10:41
发光
Rank: 1
来 自:广西
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-11-29
收藏
得分:0 
回复 2楼 筱晓绾
汗...
2010-12-06 15:59
xwanq
Rank: 2
等 级:论坛游民
帖 子:4
专家分:10
注 册:2010-12-6
收藏
得分:10 
做什么都要细心啊,我也很受教!

背起我的小房子,一个人去流浪……
2010-12-06 16:59
快速回复:为什么向左移动不了?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017689 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved