vsn4ik / input-spinner Goto Github PK
View Code? Open in Web Editor NEWA Number-Spinner, Support keyboard operations and continuous changing.
Home Page: https://vsn4ik.github.io/input-spinner/
License: MIT License
A Number-Spinner, Support keyboard operations and continuous changing.
Home Page: https://vsn4ik.github.io/input-spinner/
License: MIT License
Your package.json does not declare your license
when ussing bower-license i get this:
├─ [email protected]
│ ├─ licenses: UNKNOWN
│ └─ homepage: https://github.com/xixilive/jquery-spinner
hmmm idea good, execution not that good.
plugin is not unobtrusive which complicates everything A LOT
plugin throws null exceptions (okay, if not called on parent of input) but still if it would be unobtrusive no need to call it on parent - no exceptions - always call on element itself,...
Next Problem - if input field doesn't have attribute type="text" - plugin throughs error. The default type of an input is text though should also work with not explicitly writing the attribute.
so issue is - please redesign code ;-)
Would there be a Bower entry for this someday?
Do you have plans to add i18n on spinner plugin?
The current built in data rules for minute and second start at 1 and go to 59, but this leaves the initial minute unavailable.
They should go from 0 to 59.
I need to change the currency:
(,) to decimal separator and (.) to thousands separator
Is that possible?
Hi, I am using the hours version and noticed the control has been configure with input type as text.
I am binding and onchange
, and finding that the input box is allowing text and creating problem for me.
So, I want to set it such that it does not allow text out numbers and decimals for hour - is this possible?
does setting it type=number break with jquery 3.2?
thanks
When i'm trying to use spinner via several ajax requests to the same input, i can use only the first response data. I think it because of function call:
$(function() {
$('[data-trigger="spinner"]').spinner();
});
And destroy method should help with it.
:(
your repo has package.json but when i try to access package using npm/yarn by cli or their site, it says package is not found.
please look into it.
thanks.
I am using spinner with bootstrap 3.3.5 and jquery 1.11.3
my code
<div class="input-group spinner" id="spinner" data-trigger="spinner" style="/* display: none; */">
<input type="text" id="orderid" value="1" name="orderid" data-rule="quantity" class="form-control">
<span class="input-group-addon">
<a href="javascript:;" class="spin-up" data-spin="up">
<span class="glyphicon glyphicon-triangle-top"></span>
</a>
<a href="javascript:;" class="spin-down" data-spin="down">
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
</span>
</div>
What sets the display: none ???
I am using
$(function(){
$("#spinner").spinner("changing", function(e, newVal, oldVal){
$("#orderid").val(newVal);
});
});
$("#spinner").show();
to show it on my form
Is it the right way ?? Please, guide me.
When the mouse is moved out of the element, and then released, the button element keep focused, then so, making the number grow until i click somewhere and remove the focus from it. :)
There is a bug with the spinner where if you click the arrows up/down and drag them to the outside, the spinner continuously spins and you can't make it stop.
I thought that it might be because the up/down arrow buttons don't lose the focus state, so I tried to blur them on mouseout but it didn't work.
During testing, I've noticed that Chrome memory heap dumps show that when spinners are added then removed from the DOM their events leak and persist in the memory. This can cause slow downs over time in older browsers, e.g. IE11.
I tested this by adding 1000 individual instances of the spinners to the DOM then removing them with the jQuery .remove() method. The heap stack then shows thousands of instances of Detached elements, e.g. 2000 of those being HTMLDivElements that are still bound to a "mouseup" event.
I think this can be solved by adding a form of a destroy event that will handle purging event handlers.
启用 Rails turbolinks 之后,从其他页面的点击进入包含 spinner 功能的页面中,点击 + 或 -,加减有时是 2,3,4等的,单击事件被执行了多次,请问如何处理?? ?
It would better to provide full API functions support to manipulate the spinner, like setValue(val), getValue(), etc.
It is very difficult to change only one step by clicking arrows. Generally it changes two values. This needs a delay before changing values continuously. Also would be nice an option disable continuous change as well as mentioned #1
how to make only a click? without clamping
Hello, is there any possible way to change dynamically data-min and data-max? I need it now and I see I can only change the step.
Hi all,
I used jquery-spinner in my company project and just found it cannot support setting parameters repetitively. I.e., if i set the input attributes such as data-max = "100", data-min="1", data-step="1" in the html page , and then change it through jquery using
Thanks
Spinner style breaks up on replacing Bootstrap 2 to 3.
It's more a doubt than a issue... Did jQuery Spinner have support for negative numbers?
Hello, i have a little problem with ur spinner, this about 2 spinners on a single page. First spinner works well, but second one nope, and i dont known why :(.
First spinner - http://prntscr.com/8wn3c0 (works fine)
The second spinner appears after opening pop-up - http://prntscr.com/8wn5h2 (doesn`t work)
I can give you a link to my site, where the problem has occurred.
Thanks.
P.S.
Sry for my bad English :<
在我的购物车中添加购物车数量加减的效果,修改页面的样式
I'm working on a project where we need to accept entry of exam grades in two different grade systems... one where the grades are one of A*, A, B, C, D, E and one which the grades are A, B, C, D, E.
This leads me to think that the ability for the plugin to accept a list of labels and values in JSON form - e.g. {{'A_',50},{'A',40},{'B_',40},{'C',30},{'D*',20},{'E',10}} (or square bracketed equivalent syntax) - would address this requirement and allow the spinner to be used in many other similar situations where there is a list of values to choose from but a dropdown isn't appropriate.
The parameters Min, Max, Step and Precision would need to be ignored and in addition to a means of specifying the list itself I suggest that two new parameters would be required - one to control whether the spinner loops round the list, and one to specify what the null (unselected) value should be (if any), which in my case I would want it to be "-", for example.
Would you consider adding this feature set?
how can i stop changing the numeric in the changing:function()?
You have your package.json set to private. Can you remove this and publish so people can integrate this in their package managers.
Thanks!
I will change the code to work as this
<5 <1 [ 0 ] 1> 5>
Something like, add 5 units to field, subtract 10 from field.
Hi, I am facing issue, with enter event on text box for default value. For reference my text box is
<input type="text" class="form-control " data-max="20" data-min="0" data-step="0.1" value="10" data-rule="currency">
and i have bind the "changed" event. It's working fine if changed the value from 10 to 15 and 15 to 16. Now problem is when I changed the text box value from 16 to 10 and pressing enter without loosing the focus changed event is not getting fired.
I have debugged the library and found at line number 96 : this.oldValue is still 10 even i have updated the text box value from 10 to 15 to 16.
Please check and update the library if needed.
Thanks
I use mousedown events other input form(ex: detepicker).
Spinner "beginSpin" event can't stop after other form mouse event is activated.
The problem was solved with code change.↓
this.$el
.on('click.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin'))
.on('mousedown.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin'));
$(document).on('mouseup.spinner', $.proxy(function() {
clearTimeout(this.spinTimeout);
clearInterval(this.spinInterval);
}, this));
↓
this.$el
.on('click.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin'))
.on('mousedown.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin'));
.on('mouseup.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(function() {
clearTimeout(this.spinTimeout);
clearInterval(this.spinInterval);
}, this));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.