简体   繁体   English

jStepper的实现

[英]Implementation of jStepper

I've spent the last couple of days trying to implement jStepper.js for an .ascx file. 我花了最后几天尝试为.ascx文件实现jStepper.js。

  • I've included jQuery.jstepper.js, jQuery.mousewheel.js, & jquery-1.10.2.js in the \\jscript\\ folder of my solution. 我在解决方案的\\ jscript \\文件夹中包含了jQuery.jstepper.js,jQuery.mousewheel.js和jquery-1.10.2.js。
  • Added the following lines in my .ascx file: 在我的.ascx文件中添加了以下几行:

      <script src="/jscript/jquery.mousewheel.js" type="text/javascript"></script> <script src="/jscript/jquery.jstepper.js" type="text/javascript"></script> 
  • Added the following lines within the tags at the bottom of the .ascx file 在.ascx文件底部的标签内添加了以下几行

      // Quantity var vField = $('#Quantity'); vField.jStepper({ minValue: 0, maxValue: 23, minLength: 1, maxLength: 3, normalStep:1, shiftStep: 5, ctrlStep: 10, onStep: function (objTextField, bDirection, bLimitReached) { $slider.slider("value", objTextField.val()); updateAfterValuesChanged(); } }); 

When I put an alert() into jquery.jstepper.js, the alert shows, but jstepper is otherwise ignored. 当我将alert()放入jquery.jstepper.js时,将显示警告,但否则会忽略jstepper。 I'm sure that I'm missing something simple, but I just can't find it... 我确定我缺少一些简单的东西,但是我找不到它...

Are you absolutely sure that your element in the HTML has an id of "Quantity". 您是否绝对确定HTML中的元素的ID为“数量”。 Maybe it's all lower case ("quantity")? 也许全是小写字母(“数量”)?

Other things to note is that the call to bind jStepper has to occur after html is loaded in the browser. 其他需要注意的是,绑定jStepper的调用必须在将html加载到浏览器中之后进行。

Can we see the HTML you are trying to use? 我们可以看到您要使用的HTML吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM