码迷,mamicode.com
首页 > 其他好文 > 详细

随便代码记录

时间:2015-04-30 12:08:53      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="gbk">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <title>Mobiscroll</title>
    
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <link href="mobiscroll.custom-2.13.2.min.css" rel="stylesheet" type="text/css" />
    <script src="mobiscroll.custom-2.13.2.min.js" type="text/javascript"></script>


</head>

<body>
<input id="demos" name="scroller" />   
    <button class="btn">获取数据</button>
    
    <script type="text/javascript">
        $(.btn).on(click,function(){
            var dateV = $(input[name="scroller"]).val();
            alert(dateV);
        })
    
            var now = new Date(),
            year = now.getFullYear(),
            month = now.getMonth();

            $(#demos).mobiscroll().calendar({
                theme: mobiscroll,
                preset: date, //日期
                lang: zh,
                display: bottom,
                counter: true,
                multiSelect: true,
                defaultValue:new Date(),
                setText: 确定, //确认按钮名称
                cancelText: 取消,//取消按钮名籍我
                nowText:今天,
                endYear:2020, //结束年份
                yearText: , monthText: ,  dayText: ,  //面板中年月日文字
                hourText:小时,
                selectedValues: [ new Date(year, month, 1), new Date(year, month, 2), new Date(year, month, 10) ]
            }); 

            
            
        /**
        
            var currYear = (new Date()).getFullYear()
                var opt_data = {
                     preset: ‘date‘, //日期
                      theme: ‘android-ics  light‘,  //皮肤其他参数【android-ics light】【android-ics】【ios】【jqm】【sense-ui】【wp light】【wp】
                    display: ‘modal‘, //显示方式
                       mode: ‘mixed‘, //操作方式【scroller】【clickpick】【mixed】
                 dateFormat: ‘yy-mm-dd‘, // 日期格式
                    setText: ‘确定‘, //确认按钮名称
                 cancelText: ‘取消‘,//取消按钮名籍我
                  dateOrder: ‘yymmdd‘, //面板中日期排列格式
                   yearText: ‘年‘, monthText: ‘月‘,  dayText: ‘日‘,  //面板中年月日文字
                    endYear:2020, //结束年份
                    showNow:true,
                    nowText:‘今天‘,
                   hourText:‘小时‘,
                 minuteText:‘分‘,
                   startYear:currYear, 
                    display:‘bottom‘,//显示方式【modal】【inline】【bubble】【top】【bottom】
                };
                $("#demos").mobiscroll(opt_data);
        
        
        
         /** $(function(){
            var opt = {
                preset: ‘date‘, //日期
                theme: ‘sense-ui‘, //皮肤样式
                display: ‘modal‘, //显示方式 
                mode: ‘scroller‘, //日期选择模式
                dateFormat: ‘yy-mm-dd‘, // 日期格式
                setText: ‘确定‘, //确认按钮名称
                cancelText: ‘取消‘,//取消按钮名籍我
                dateOrder: ‘yymmdd‘, //面板中日期排列格式
                dayText: ‘日‘, monthText: ‘月‘, yearText: ‘年‘, //面板中年月日文字
                endYear:2020 //结束年份
            };
            $("#scroller").mobiscroll(opt).date(opt);*/
        
        //之前给群里共享发错了。记得之前写过一个,估计丢了。现在重写一个。并完善一下,下面注释部分是上面的参数可以替换改变它的样式
        //希望一起研究插件的朋友加我个人QQ也可以,本人也建个群 291464597 欢迎进群交流。哈哈。这个不能算广告。
        // 直接写参数方法
        //$("#scroller").mobiscroll(opt).date(); 
        // Shorthand for: $("#scroller").mobiscroll({ preset: ‘date‘ });
        //具体参数定义如下
        //{
        //preset: ‘date‘, //日期类型--datatime,
        //theme: ‘ios‘, //皮肤其他参数【android-ics light】【android-ics】【ios】【jqm】【sense-ui】【sense-ui】【sense-ui】
                                    //【wp light】【wp】
        //mode: "scroller",//操作方式【scroller】【clickpick】【mixed】
        //display: ‘bubble‘, //显示方【modal】【inline】【bubble】【top】【bottom】
        //dateFormat: ‘yyyy-mm-dd‘, // 日期格式
        //setText: ‘确定‘, //确认按钮名称
        //cancelText: ‘清空‘,//取消按钮名籍我
        //dateOrder: ‘yymmdd‘, //面板中日期排列格
        //dayText: ‘日‘, 
        //monthText: ‘月‘,
        //yearText: ‘年‘, //面板中年月日文字
        //startYear: (new Date()).getFullYear(), //开始年份
        //endYear: (new Date()).getFullYear() + 9, //结束年份
        //showNow: true,
        //nowText: "明天",  //
        //showOnFocus: false,
        //height: 45,
        //width: 90,
        //rows: 3}
    //});
    </script>
</body>
</html>

 

随便代码记录

标签:

原文地址:http://www.cnblogs.com/xinlinux/p/4468289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!