数值微调器

来源:互联网 发布:php date 取时间 编辑:程序博客网 时间:2024/04/30 06:36

1、用DoJo实现数值微调器

NumberSpinner.html:

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>数值微调器</title><link rel="stylesheet" type="text/css" href="dojoroot/dojo/resources/dojo.css"><link rel="stylesheet" type="text/css" href="dojoroot/dijit/themes/tundra/tundra.css"><script type="text/javascript" src="dojoroot/dojo/dojo.js" djConfig="parseOnLoad:true"></script><style type="text/css">   .form_body{      width:20%;      background-color: #CCCCCC;       padding: 10px 10px 10px 10px;   }   label {  font-weight: bold;  color: #FF0000;   }</style><script type="text/javascript">   dojo.require("dojo.parser");   dojo.require("dijit.form.Form");   dojo.require("dijit.form.Button");   dojo.require("dijit.form.NumberSpinner");</script><script type="dojo/method">   dojo.mixin(this,{          reset:function(){            this.setValue(0);        }    });</script></head><body class="tundra">   <form dojoType="dijit.form.Form" class="form_body">        <label for="number">数值微调器:</label>        <input dojoType="dijit.form.NumberSpinner" constraints="{min:-100,max:100}" value=0/>        <br/><br/>        <label for="numberSpinner">数值微调器:</label>        <input dojoType="dijit.form.NumberSpinner" constraints="{min:-100,max:100}" jsId="numberSp"               value=0/>        <br/><br/>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        <button dojoType="dijit.form.Button" onclick="numberSp.reset()">重置</button>   </form></body></html>

2、运行项目是,Tomcat运行后出现:

七月 10, 2013 12:33:19 上午 org.apache.catalina.core.AprLifecycleListener init严重: An incompatible version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24七月 10, 2013 12:33:21 上午 org.apache.catalina.core.AprLifecycleListener init严重: An incompatible version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24七月 10, 2013 12:33:21 上午 org.apache.catalina.core.AprLifecycleListener init严重: An incompatible version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24七月 10, 2013 12:33:21 上午 org.apache.catalina.core.AprLifecycleListener init严重: An incompatible version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24七月 10, 2013 12:33:22 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:dojo' did not find a matching property.七月 10, 2013 12:33:22 上午 org.apache.catalina.core.AprLifecycleListener init严重: An incompatible version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.24七月 10, 2013 12:33:23 上午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["http-bio-8080"]七月 10, 2013 12:33:23 上午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["ajp-bio-8009"]七月 10, 2013 12:33:23 上午 org.apache.catalina.startup.Catalina load信息: Initialization processed in 5444 ms七月 10, 2013 12:33:23 上午 org.apache.catalina.core.StandardService startInternal信息: Starting service Catalina七月 10, 2013 12:33:23 上午 org.apache.catalina.core.StandardEngine startInternal信息: Starting Servlet Engine: Apache Tomcat/7.0.42七月 10, 2013 12:33:24 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [419] milliseconds.七月 10, 2013 12:33:24 上午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["http-bio-8080"]七月 10, 2013 12:33:24 上午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["ajp-bio-8009"]七月 10, 2013 12:33:24 上午 org.apache.catalina.startup.Catalina start信息: Server startup in 1388 ms

   这个是严重警告,对项目运行没有影响,关键之处是把JS和CSS引入的路径弄错了,导致结果显示不出来!

3、运行结果如图所示:

(1)未点击任何按钮


(2)点击上下按钮


(3)点击“重置”按钮


原创粉丝点击