小tips:jquery datapicker中,用图片按钮弹出日历框

在jquery datapicker中,如果要在日历框旁边的小图片,当点小图片时,
弹出日历框,可以这样写:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet"
    href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css"
        type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"
    type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"
        type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            $('#<%= txtDate.ClientID  %>').datepicker({
                buttonImage: '../../images/icons/calendar.png',
                buttonImageOnly: true,
                showOn: 'button'
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
    </form>
</body>
</html>

你可能感兴趣的:(jquery)