如何获取不同大小的日期选择器实例?
我为我的主页设置了一个日期选择器,现在我想为我的其他一些东西设置它。问题是我需要它比我在主页上使用的小。有没有办法为日期选择器的不同实例设置不同的大小?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jQueryUI 使用 CSS 来设置其所有小部件的样式,这些小部件通常作为主题存储在 CSS 文件中。根据您使用的主题,它可能可行,也可能不可能。
如果您使用的主题使用
ems
或%
作为width
和font-size
,那么您可以轻松创建一种新风格,改变所有子元素的外观。例如:
如果您正在寻找纯 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 thewidth
andfont-size
, then you could easily create a new style that would alter the look of all of its children.For example:
If you're looking for a pure Javascript solution or an option to pass to the datepicker widget, unfortunately, there isn't one.
您可以设计并加载与默认 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.