如何获取不同大小的日期选择器实例?

发布于 2024-12-26 05:33:27 字数 83 浏览 4 评论 0原文

我为我的主页设置了一个日期选择器,现在我想为我的其他一些东西设置它。问题是我需要它比我在主页上使用的小。有没有办法为日期选择器的不同实例设置不同的大小?

I got a datepicker set up for my main page and now I wanna set it up for some of my other stuff. The problem is that I need it smaller than what I'm using on the main page. Is there a way to have different sizes for different instances of the datepicker?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

腹黑女流氓 2025-01-02 05:33:27

jQueryUI 使用 CSS 来设置其所有小部件的样式,这些小部件通常作为主题存储在 CSS 文件中。根据您使用的主题,它可能可行,也可能不可能。

如果您使用的主题使用 ems% 作为 widthfont-size,那么您可以轻松创建一种新风格,改变所有子元素的外观。

例如:

.someClassNotOnTheMainPage .datepicker {
   font-size:.75em;
   ...
}

如果您正在寻找纯 Javascript 解决方案或传递给日期选择器小部件的选项,不幸的是,没有。

jQueryUI uses CSS to style all of it's widgets, and those are typically stored in a CSS file as theme. Depending on the theme you're using it may or may not be possible.

If the theme you're using uses ems or % for the width and font-size, then you could easily create a new style that would alter the look of all of its children.

For example:

.someClassNotOnTheMainPage .datepicker {
   font-size:.75em;
   ...
}

If you're looking for a pure Javascript solution or an option to pass to the datepicker widget, unfortunately, there isn't one.

尐偏执 2025-01-02 05:33:27

您可以设计并加载与默认 jQueryUI 主题不同的 css。虽然日历主题通常具有相同的大小,但您可以选择根据您的需要个性化此功能。

You can design and load a different css than the default jQueryUI theme. Although the themes usually have the same size for the calendar, you can choose to personalize this feature to your needs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文