2016-06-21 92 views
0
完全正常

https://jqueryui.com/datepicker/jQuery UI的不DatePicker的

enter image description here

的jQuery UI的日期选择器看起来就像上面,但我的版本如下所示。 enter image description here

我的jQuery文件是

enter image description here

public class BundleConfig 
    { 
     // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 
     public static void RegisterBundles(BundleCollection bundles) 
     { 
      bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
         /*"~/Scripts/jquery-{version}.js",*/ 
         "~/Scripts/jquery-1.12.4.min.js")); 

      bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
         //"~/Scripts/jquery-ui-{version}.js", 
         // "~/Scripts/jquery-ui-*", 

         "~/Scripts/jquery.switchButton.js", 
         "~/Scripts/jquery-ui.min.js" 
         )); 

      bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
         "~/Scripts/jquery.validate*")); 

      bundles.Add(new ScriptBundle("~/bundles/dataTables").Include(
         "~/Scripts/media/js/jquery.dataTables.js")); 

      bundles.Add(new ScriptBundle("~/bundles/moment").Include(
         "~/Scripts/moment.js")); 

      // Use the development version of Modernizr to develop with and learn from. Then, when you're 
      // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 
      bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
         "~/Scripts/modernizr-*")); 

      bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
         "~/Scripts/bootstrap.js", 
         "~/Scripts/respond.js")); 

      bundles.Add(new StyleBundle("~/Content/css").Include(
         "~/Content/bootstrap.css", 
         "~/Content/site.css")); 
     } 
    } 
} 

我添加的jQuery和jQuery UI的最新的稳定版本,并改变了包的配置,以避免重复错误(这是我不得不开始见Uncaught TypeError: undefined is not a function in datepicker

enter image description here

一个StackOverflow答案说,moment.js应该高于jQuery UI,但我没有发现任何变化,现在我完全难住了,因为没有看到jQuery UI部分像这样工作。请帮忙!

回答

2

答案很简单..您还没有添加引用jquery-ui.css。它只是工作正常,但styles/CSS不适用。

得到CSS通过this answer

+1

提到的链接各个版本太感谢你了,对不起已故性反应 –

+0

涅瓦河的心..编码愉快.. :) –