加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

数值微调器

发布时间:2020-12-16 21:35:05 所属栏目:百科 来源:网络整理
导读:1、用DoJo实现数值微调器 NumberSpinner.html: !DOCTYPE htmlhtmlheadmeta charset="UTF-8"title数值微调器/titlelink rel="stylesheet" type="text/css" href="dojoroot/dojo/resources/dojo.css"link rel="stylesheet" type="text/css" href="dojoroot/di

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,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,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)点击“重置”按钮

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读