Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery datepicker animation options wont work

I have a textbox which has JQuery UI DatePicker control registered to it. It works fine but when I try to add animation options, control itself wont work.

<head runat="server">
<script>
    $(document).ready(function() {
        $("#TextBox1").datepicker("option", "showAnim", 'slideDown');
    });
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </div>
    </form>
</body>

Without the options, the picker would at least show itself. Can someone tell me a solution and better, what's happening? Thanks!

like image 586
Null Head Avatar asked Dec 04 '22 09:12

Null Head


1 Answers

define options after init:

// initialization (~= constructor)
$("#TextBox1").datepicker();
// set options
$("#TextBox1").datepicker("option", "showAnim", 'slideDown');

or at the same time:

// initialization + options (~= constructor with args)
$("#TextBox1").datepicker({showAnim: 'slideDown'});

to resize it add this style to your html file after the <link> to jquery.ui.all.css (or in your custom .css):

<style type="text/css">
    div.ui-datepicker{
     font-size:...px;
    }
</style>
like image 165
manji Avatar answered Jan 05 '23 16:01

manji