Jquery ui jQuery日期选择器不';不要出现在Firefox中

Jquery ui jQuery日期选择器不';不要出现在Firefox中,jquery-ui,firefox,twitter-bootstrap,jquery-ui-datepicker,Jquery Ui,Firefox,Twitter Bootstrap,Jquery Ui Datepicker,我有一个使用平面UI工具包的输入表单,它必须包含一个日期选择器,所以我选择使用jQuery的小部件。但当我在Chrome上运行它时,datepicker会显示出来,而在Firefox上它会显示为一个简单的文本输入。 这是我的密码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>My test &middot; st

我有一个使用平面UI工具包的输入表单,它必须包含一个日期选择器,所以我选择使用jQuery的小部件。但当我在Chrome上运行它时,datepicker会显示出来,而在Firefox上它会显示为一个简单的文本输入。 这是我的密码:

 <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My test &middot; stuff with datepicker</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Loading Bootstrap -->
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="bootstrap/css/prettify.css" rel="stylesheet">

    <!-- Loading Flat UI -->
    <link href="css/flat-ui.css" rel="stylesheet">
    <link href="css/docs.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">
    <!--  my addition jQuery UI for datepicker -->
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

    <script src="js/jquery-1.9.1.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>
    <script src="bootstrap/js/google-code-prettify/prettify.js"></script>
    <script src="js/application.js"></script>                

    <style>
           .containerx {
        background-color: #1abc9c;
        background-repeat: no-repeat;
        background-position: bottom right;
        background-attachment: scroll;
        }      
        .titluedit{
        margin: 0 0 0 0;
        font-size:14px;
        }

        .titlueditx{
        margin: 0 0 0 0;
        font-size:14px;
        color:red;
        }

        fieldset { margin: 0 0 10px 0; }
    </style>

    <script>
    </script>

    <script>
            $(document).ready(function(){
                $(function() {
                    $( "#datepicker" ).datepicker();
                });    
            });    

    </script>    

  </head>
  <body>
  <img src="images/logo2.png" alt="logox" height="81" width="305"> 
        <h1 class="demo-panel-title" style="text-align:center; color:#d35400">XXXXXXXXX</h1>
        <h3 class="demo-panel-title" style="text-align:center; color:#1abc9c">New info</h3>

       <div class="container" style="width:900px; margin:0 auto;"> 
<form action="save.php" method="post">
            <div class="container" style="width:700px; margin:0 auto;"> 
                    <fieldset>
                    <p class="titlueditx">Name *:</p>
                    <input type="text" name="nume" value="" placeholder="Name" class="form-control" />
                    </fieldset>

                    <fieldset>
                        <p class="titlueditx">Medium time *:</p>
                        <input type="text" name="durata" value="" placeholder="minutes" class="form-control" />
                    </fieldset>

                        <p class="titlueditx">Start date  *:</p>
                        <input type="date" id="ui-datepicker" name="dataang" value="" class="form-control"/><br>

                    <fieldset>
                        <p class="titlueditx">Some other stuff *:</p>
                        <input type="text" name="sefutzul" value="" placeholder="Other relevant stuff" class="form-control" />
                    </fieldset>

            </div>

  <br><br>
    <div class="container" style="width:700px; margin:0 auto;"> 
        <table>
            <tr>
                <td>      
                    <input type="hidden" id="idhidfirma" name="idfirma" value="1" />       
                    <input type="hidden" id="idhnumefirma" name="numefirma" value="xxxxx" />       
                    <button type="submit" class="btn btn-hg btn-primary">        Save info      </button>  

</form>
                </td>
        <td>  
            <form action="mylist.php" method="post">                    
                <INPUT TYPE="hidden" NAME="idfirma" value="1">                     
                <INPUT TYPE="hidden" NAME="numefirma" value="xxxxx">             
                <button type="submit" class="btn btn-hg btn-danger">              Cancel            </button>  
            </form>
        </td>
    </tr>
           </table>
      </div>
    </div>      



</body></html>                

我的测试·;带日期选择器的东西
.集装箱{
背景色:#1abc9c;
背景重复:无重复;
背景位置:右下角;
背景附件:滚动条;
}      
titluedit先生{
保证金:0;
字体大小:14px;
}
.titlueditx{
保证金:0;
字体大小:14px;
颜色:红色;
}
字段集{margin:0 10px 0;}
$(文档).ready(函数(){
$(函数(){
$(“#日期选择器”).datepicker();
});    
});    
XXXXXXXXX
新信息
名称*:

中期*:

开始日期*:


其他一些东西*:



保存信息 取消
我能做些什么使它在Firefox中也能工作


同样在Chrome中,我如何使日历在一天中关闭一次单击?现在,日历将一直显示,直到我单击屏幕上的其他位置。

问题不是Firefox,而是您定义的:

  • 输入类型=id为
    ui日期选择器的日期
  • 将jQuery UI日期选择器绑定到id
    datepicker
  • 第二个选择器不匹配任何元素,因此jQueryUIDatePicker不绑定到任何东西;通过使用输入类型=日期,Chrome会自动呈现一个日历控件,因此您可以根据输入类型在Chrome中看到日历(请参阅)

    要解决所有浏览器中的问题,您可以在
    ui日期选择器
    元素中设置input type=text,并设置正确的选择器

    代码:


    演示:

    日期选择器正在使用firefox,但是日期选择器的
    z-index
    在“-”中。所以它不会出现在firefix浏览器中。 显示通过jquery更新datepicker的
    z-index
    ,它将出现

    $(".datepicker").css("z-index","100");
    

    如果mozila firefox无法更新您的firefox版本,它将在mozila firefox上运行。 我运行这个程序,它工作正常。谢谢

    <head>
      <meta charset="UTF-8" />
      <title>Datepicker fadein</title>
      <link  href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
      <script src="http://code.jquery.com/jquery-1.9.0.js"></script>
      <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
      <script type="text/javascript">
            $(function(){
                $('.datepicker').datepicker({showAnim: "fadeIn"});
            })
     </script>
    
    
    日期选择器
    $(函数(){
    $('.datepicker').datepicker({showAnim:“fadeIn”});
    })
    

    在页面正文中使用输入

    <input class="datepicker">
    
    
    
    您能在JSFIDLE上提供该问题的演示吗?是的。。。这是一个演示我的问题是什么。我没有将bootstrap.js包含在其中,但行为仍然是一样的,所以请尝试从firefox访问小提琴,然后从chrome访问小提琴。在chrome中,日期编辑将显示一个日期选择器,而firefox将只显示一个简单的文本输入框,或者更好(更精简的版本),非常感谢。我放在JSFIDLE中的代码是两个单独测试组合成一个代码的结果。。。我忽略了身份证:(。谢谢
    <input class="datepicker">