Jitesh Byahut 2/25/2014 4922

How To Use Jquery Spinner In JQuery

Here we are using jquery spinner in Asp.Net

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>JQuery-spinner</title>

    <script src="../../Scripts/Jquery-ui/js/jquery-1.9.1.js" type="text/javascript"></script>

    <script src="../../Scripts/Jquery-ui/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>

    <link href="../../Scripts/Jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet" />

    <script type="text/javascript">

        $(document).ready(function () {

 

            $("#txtSpin").spinner({

                min:0,max:100

            }); 

           

        });

    </script>   

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <asp:TextBox ID="txtSpin" runat="server"></asp:TextBox>

    </div>

    </form>

</body>

</html>

View output :

demoimage

You can use spinner for decimal

$("#txtSpin").spinner({

                min: 0,

                max: 100,

                step: 0.01,

                numberFormat:"n"

            });

View output :

demoimage

You can use spinner for fixed step increament of digit

$("#txtSpin").spinner({

                min: 0,

                max: 100,

                step: 5,

                start:25,

                numberFormat: "n"

            });

View output :

demoimage


Please give your feedback for improving this page