jtsage / jquery-mobile-spinbox Goto Github PK
View Code? Open in Web Editor NEWA simple spinner for number inputs in jQueryMobile
Home Page: http://dev.jtsage.com/jQM-Spinbox/
A simple spinner for number inputs in jQueryMobile
Home Page: http://dev.jtsage.com/jQM-Spinbox/
Hi,
The horizontal spinner on my android smartphone breaks the buttons and text into separate lines. Not occurring on a desktop browser if [more than] enough width is provided.
Added the following line:
$ diff jqm-spinbox.js.1 jqm-spinbox.js
43a44
> w.d.input.css({'display':'inline-block'});
Hi, this worked before ajax, how to trigger or update after ajax load?
plz advise.
thx.
I created spinbox as below.
var spinbox = "
"$(target).append(spinbox);
Then change min/max/value in other function as below since I would like to change min/max value depends on user's selection.
$('#' + id).spinbox({"dmax": max});
$('#' + id).spinbox({"dmin": min});
$('#' + id).val(val);
$('#' + id).text("refresh");
But UI(+,-) button layout seems something wrong.
When use following function to change max/min value, UI's becomes normal.
$('#' + id).attr("min", min);
$('#' + id).attr("max", max);
However above min/max values are not read after function creation. So it does not work correctly.
As temporary solution, I've modified jqm-spinbox.js as below to read min/max value from attribution when user press spinbox and it works.
_offset: function( obj, direction ) {
var tmp,
w = this,
o = this.options;
if ( !w.disabled ) {
o.dmin = ( typeof w.d.input.attr('min') !== 'undefined' ) ? parseInt(w.d.input.attr('min'),10) : Number.MAX_VALUE * -1; <= Added
o.dmax = ( typeof w.d.input.attr('max') !== 'undefined' ) ? parseInt(w.d.input.attr('max'),10) : Number.MAX_VALUE; <= Added
How can I set min/max value correctly?
Thanks
I have tried your demo with Chrome 54 & 55 on Windows 10 and found the Up/Down buttons do not work.
It works with me Firefox 50 and Edge. I can also get it work with Chrome if I switch to the mobile device view in the developer console.
EDIT: Strange enough, only some users are affected. It seems to work on some Windows 10 systems. pimatic/pimatic#1030 (comment)
When the step option is set to a non-integer value (ie. 0.5), it seems the step is rounded (ie. 0.5 = 1).
I recommend you move the following code outside of the "if" statement it is currently in:
w.places = w._decimalPlaces(o.step);
The "-" button is now increasing the number in the input field. The Spinbox Demo page is showing this as well.
Hi, if you are on a desktop machine with a mouse you can start a spin but if you then drag the mouse outside of the + or - button and release the mouse the spin continues.
First of all, thank you very much for this nice plugin.
I have some numeric fields that holds decimal numbers, so the current implementation (for integers) is not working for those fields. Is there any chance to add a "step" attribute to the spinbox
so that the plus/minus buttons would increment/decrease the value by e.g. 0.1
? I would be more than happy to see this feature.
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.