2016-06-21 72 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

涅瓦河的心..編碼愉快.. :) –