Datepicker(月和年)在fancybox中不起作用 [英] Datepicker (month and year) not working inside fancybox

查看:109
本文介绍了Datepicker(月和年)在fancybox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的fancybox 3和jquery ui datepicker出现问题. 如果我将datepicker放置在fancybox之外..几个月和几年的下拉列表正在工作..但是当我将其放置在fancybox内时.下拉菜单不会被触发.知道发生了什么事吗?

$("#Date_To").datepicker({changeMonth: true,changeYear: true});

图像

解决方案

尝试禁用聚焦,如下所示:

$('[data-fancybox]').fancybox({
    autoFocus : false,
    trapFocus : false,
    touch     : false,
    beforeClose : function() {
        $( ".selector" ).datepicker( "hide" );
    }
});

演示- https://codepen.io/fancyapps/pen/QqLXaz

I am having a problem with my fancybox 3 and jquery ui datepicker. if I place the datepicker outside the fancybox.. the dropdown for months and years are working.. but when I place it inside fancybox. the dropdown is not being triggered. any idea what is happening?

$("#Date_To").datepicker({changeMonth: true,changeYear: true});

image

解决方案

Try disabling focusing, something like this:

$('[data-fancybox]').fancybox({
    autoFocus : false,
    trapFocus : false,
    touch     : false,
    beforeClose : function() {
        $( ".selector" ).datepicker( "hide" );
    }
});

Demo - https://codepen.io/fancyapps/pen/QqLXaz

这篇关于Datepicker(月和年)在fancybox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆