微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jQuery datetimepicker不在日历周围显示漂亮的格式框

如何解决jQuery datetimepicker不在日历周围显示漂亮的格式框

我已经使用了几个小时了。看来CSS无法正常工作,但是我不知道为什么。我已将其包含在捆绑包中,

public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js","~/Scripts/jquery-ui-1.12.1.js","~/Scripts/jquery-ui-timepicker-addon.js","~/Scripts/Scott.js"
                        ));

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

            // Use the development version of Modernizr to develop with and learn from. Then,when you're
            // ready for production,use the build tool at https://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"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css","~/Content/jquery-ui-timepicker-addon.css","~/Content/site.css"));
        }

并且我已经在_layout页面中渲染了它。

<head>
    <Meta charset="utf-8" />
    <Meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts",required: false)
</head>

但是,当我运行程序并单击datetime字段时,它看起来像这样:

enter image description here

是设置还是我的设备有故障? 谢谢您的帮助。 -斯科特。

解决方法

原来,我缺少jquery-ui.css。一旦我添加了这个css文件,一切都会正常显示。不知何故,当我添加jQuery.UI.Combined 1.12.1时,它也没有添加css文件。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。