基本信息
源码名称:datepicker日期插件演示9种调用方法
源码大小:0.05M
文件格式:.zip
开发语言:js
更新时间:2019-04-09
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍


选择最近3个月的日历如下:




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <title>datepicker日期插件演示9种调用方法</title>
        <link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
        <style type="text/css">
            .stars{color:#ff6600;height:30px;line-height: 30px;font-size: 13px;margin: 0 0 20px}
            .tip{position:absolute;top:0;left:0;z-index:9999;border: 1px solid #D6D6D6;padding:5px 12px;background-color: #FFF;display: none;color:#FF6600;}
            .intro{margin-left:8px;color:#1B1B1B}
            .stars img{vertical-align: top;position: relative;top:4px;cursor:pointer;}
            .stars label{width:70px;display: inline-block;color:#333}
            .comment_title{width:45px;display: inline-block}
            .example{width:500px; margin:20px auto}
.example h4{height:32px; line-height:32px; font-size:14px}
.example h4 span{font-weight:500; font-size:12px}
.example p{line-height:28px;}
input{width:108px; height:20px; line-height:20px; padding:2px; border:1px solid #d3d3d3}

.ui-datepicker-calendar td a{padding:0px;}
        </style>
    </head>
    <body>
        <div class="container">
            <div class="demo">
                <div class="example">
                    <h4>1、默认格式:<span>yy-mm-dd</span></h4>
                    <p>日期:<input type="text" id="date_1" readonly /></p>
                </div>
                <div class="example" id="s2">
                    <h4>2、格式化日期:<span>yy年mm月dd日</span></h4>
                    <p>日期:<input type="text" id="date_2" readonly /></p>
                </div>
                <div class="example" id="s3">
                    <h4>3、设置日期可选范围:<span>当前日期前30天</span></h4>
                    <p>日期:<input type="text" id="date_3" readonly /></p>
                </div>
                <div class="example" id="s4">
                    <h4>4、关联同步不同的日期格式:</h4>
                    <p>日期:<input type="text" id="date_4" readonly /> &nbsp; <input type="text" id="alternate"  style="width:150px" /></p>
                </div>
                <div class="example">
                    <h4>5、直接显示日历:</h4>
                    <div id="datepicker"></div> 
                </div>
                <div class="example">
                    <h4>6、显示日期所在一年中的周数:</h4>
                    <p>日期:<input type="text" id="date_6" readonly /></p>
                </div>
                <div class="example" id="s7">
                    <h4>7、显示连续的3个月的日历:</h4>
                    <p>日期:<input type="text" id="date_7" readonly /></p>
                </div>
                <div class="example" id="s8">
                    <h4>8、通过点击图标触发显示日历:</h4>
                    <p>日期:<input type="text" id="date_8" readonly style="height:16px" /></p>
                </div>
                <div class="example" id="s9">
                    <h4>9、选中日期后触发事件:</h4>
                    <p>日期:<input type="text" id="date_9" readonly /></p>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-datepicker.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#date_1").datepicker();
                $("#date_2").datepicker({
                    //navigationAsDateFormat: true,
                    dateFormat: 'yy年mm月dd日'
                });
                $("#date_3").datepicker({
                    minDate: -30,
                    maxDate: 0
                });
                $("#date_4").datepicker({
                    altField: "#alternate",
                    altFormat: "yy年MMd日,DD"
                });
                $("#datepicker").datepicker({
                    showOtherMonths: true,
                    selectOtherMonths: false
                });
                $("#date_6").datepicker({
                    showWeek: true
                });
                $("#date_7").datepicker({
                    numberOfMonths: 3,
                    showButtonPanel: true
                });
                $("#date_8").datepicker({
                    showOn: "button",
                    buttonImage: "images/calendar.gif",
                    buttonImageOnly: true
                });
                $("#date_9").datepicker({
                    onSelect: function(dateText, inst) {
                        alert("您选择的日期是:"   dateText)
                    }
                });
            });
        </script>
    <script type="text/javascript" src="http://shouce.ren/static/ad/gg.js"></script></body>
</html>