在浏览起页面上有没有对数字进行加减的控件?请高手给一个。类似于windows的时间编辑页面的图片一样,我们可以直接点击向上,向下的箭头来对年份,月份,等进行增加,减少的操作。

解决方案 »

  1.   

    没有这样的控件,还是建议直接用select控件代替好了。用程序来代替这样的控件也不太方便,因为输入方式很多,有键盘,有鼠标,有粘贴。
      

  2.   


      <TABLE cellpadding=0 cellspacing=0>
      <TR>
    <TD rowspan=2><INPUT TYPE="text" NAME="inp" value="0" onfocus="this.blur()"></TD>
    <TD><INPUT TYPE="button" VALUE="^" ONCLICK="doit(1)" style="width:20;height:10"></TD>
      </TR>
      <TR>
    <TD><INPUT TYPE="button" VALUE="ˇ" ONCLICK="doit(-1)" style="width:20;height:10"></TD>
      </TR>
      </TABLE> function doit(para){
    var num = parseInt(inp.value);
    inp.value = num + para;
    }
      

  3.   

    head>
        <title>无标题页</title>
        <script type="text/javascript">
            function up()
            {
                var t=document.getElementById("input").value;
                document.getElementById("input").value=parseInt(t)+1;
            }
            function down()
            {
                var t=document.getElementById("input").value;
                document.getElementById("input").value=parseInt(t)-1;
            }
        </script>
    </head>
    <body>
    <div id="ss" style="position:relative; padding:0; height:1.2em; width:100px;border:solid 1px blue;">
        <input id="input" value="10" style="height:1em; width:80px; padding: 0 2px; position:absolute;border:0px;" />
        <a href="javascript:up();" style="position:absolute; right:0px; border:solid 1px blue; height:0.5em;">
            <img src="up.jpg" style=" border-width:0px; position:relative;top: -3px; width:20px; height:0.5em" />
        </a>
        <a href="javascript:down();" style="position:absolute; right:0px; border:solid 1px blue; bottom:0px; height:0.5em;">
            <img src="down.jpg" style=" border-width:0px; position:relative;top: -3px;width:20px; height:0.5em" />
        </a>
    </div>
    </body>
      

  4.   

    呵呵。多谢wxg22526451,及zyzy15两位,你们提供的办法,让我的问题解决了。