Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/453.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript DateBox Jquery移动扩展_Javascript_Jquery_Html_Jquery Mobile_Datebox - Fatal编程技术网

Javascript DateBox Jquery移动扩展

Javascript DateBox Jquery移动扩展,javascript,jquery,html,jquery-mobile,datebox,Javascript,Jquery,Html,Jquery Mobile,Datebox,我试图对datebox进行扩展,首先需要选择日期,然后单击“选择日期” 一切都很好,差不多。当我点击“选择日期”按钮时,模式窗口后面的内容被点击,在我的例子中,它是一个搜索按钮 有人知道为什么吗 if (o.useSelectDateButton) { $('<a href="#">Välj datum</a>') .appendTo(hRow).buttonMarkup({ theme: o.theme, ico

我试图对datebox进行扩展,首先需要选择日期,然后单击“选择日期”

一切都很好,差不多。当我点击“选择日期”按钮时,模式窗口后面的内容被点击,在我的例子中,它是一个搜索按钮

有人知道为什么吗

 if (o.useSelectDateButton) {
            $('<a href="#">Välj datum</a>')
                .appendTo(hRow).buttonMarkup({ theme: o.theme, icon: 'check', modal: true, iconpos: 'left', corners: true, shadow: true })
                .on(o.clickEvent, function(e) {
                    if ($(this).jqmData('enabled')) {
                        w.theDate.set(2, 1).set(1, $(this).jqmData('month')).set(2, $(this).jqmData('date'));
                        w.d.input.trigger('datebox', { 'method': 'set', 'value': w._formatter(w.__fmt(), w.theDate), 'date': w.theDate });
                    }

                    if (w.theDate == new Date()) {
                        w.theDate.set(2, 1).set(1, $(this).jqmData('month')).set(2, $(this).jqmData('date'));
                        w.d.input.trigger('datebox', { 'method': 'set', 'value': w._formatter(w.__fmt(), w.theDate), 'date': w.theDate });
                    }
                    w.d.input.trigger('datebox', { 'method': 'close' });
                });
        }
if(o.useSelectDate按钮){
$('')
.appendTo(hRow).buttonMarkup({theme:o.theme,icon:'check',modal:true,iconpos:'left',corners:true,shadow:true})
.打开(o.单击事件,函数(e){
if($(this).jqmData('enabled')){
w、 set(2,1).set(1,$(this.jqmData('month')).set(2,$(this.jqmData('date'));
w、 d.input.trigger('datebox',{'method':'set','value':w.u fmt(),w.theDate),'date':w.theDate});
}
如果(w.theDate==新日期()){
w、 set(2,1).set(1,$(this.jqmData('month')).set(2,$(this.jqmData('date'));
w、 d.input.trigger('datebox',{'method':'set','value':w.u fmt(),w.theDate),'date':w.theDate});
}
w、 触发器('datebox',{'method':'close'});
});
}
我这样称呼日期框:

 <input name="datepicker" id="datepicker" type="date" data-role="datebox" data-options='{"mode": "calbox", "calShowWeek": true, "overrideCalStartDay": 1, "useModal": true, "useAltIcon": true, "afterToday": true, "useFocus": true }'>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
<p>Date: <input type="text" id="datepicker" /></p>

添加了一个JSFIDLE


问题是我无法在浏览器中重新创建该问题,它只发生在移动设备中。

你能处理这个问题吗?你使用哪些jquery库来处理这个问题

另一个选项/备选方案:

 <input name="datepicker" id="datepicker" type="date" data-role="datebox" data-options='{"mode": "calbox", "calShowWeek": true, "overrideCalStartDay": 1, "useModal": true, "useAltIcon": true, "afterToday": true, "useFocus": true }'>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
<p>Date: <input type="text" id="datepicker" /></p>

这是一个非常简单的datetimepicker,它包含jquery库,并且很容易实现

头标签:

 <input name="datepicker" id="datepicker" type="date" data-role="datebox" data-options='{"mode": "calbox", "calShowWeek": true, "overrideCalStartDay": 1, "useModal": true, "useAltIcon": true, "afterToday": true, "useFocus": true }'>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
<p>Date: <input type="text" id="datepicker" /></p>

$(函数(){
$(“#日期选择器”).datepicker();
});
正文标签:

 <input name="datepicker" id="datepicker" type="date" data-role="datebox" data-options='{"mode": "calbox", "calShowWeek": true, "overrideCalStartDay": 1, "useModal": true, "useAltIcon": true, "afterToday": true, "useFocus": true }'>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
<p>Date: <input type="text" id="datepicker" /></p>
日期:


我用JSFIDLE更新了我的帖子,问题是我只能在移动设备上重新创建它。