JQuery UI Spinner Width

I use the jQuery UI spinner on my pages, which now require a response, which gives us the ability to dynamically change the width of the jQuery UI spinners.

Does anyone know how to do this?

HTML

<input type="text" id="myspinner" style="width: 50px" />

Javascript

$(function(){ 
    $("#myspinner").spinner(); 
});
+4
source share
1 answer

solvable

Sorry, I lagged a bit and was looking for a jQuery way around this problem, but since then I realized that I could only adjust the original input field width to achieve the desired effect, as shown below.

@media screen and (max-width: 1000px) and (min-width: 480px) {
    #myspinner{
        width: 30px;
    }
}

or if you prefer to use jQuery

$("#myspinner").width(30);

Once this is called, the jQuery UI widget automatically resizes around the input window

+6
source

All Articles