jQuery DatePicker 太大

发布于 2024-11-25 05:13:15 字数 316 浏览 2 评论 0原文

我已经实现了 jQuery 日期选择器。它似乎工作正常,但日历太大。

jQuery Datepicker http://www.softCircuits.com/Client/datepicker.png

我正在处理的网站有多层样式表、父页面和控件。我似乎无法找出是什么让它变大。 (抱歉,该网站不公开。)

看来日历是基于字体大小的。我尝试将文本框包装在具有较小字体的 div 中,但它似乎忽略了这一点。有什么办法可以指定固定的字体大小吗?

I've implemented the jQuery datepicker. It seems to be working fine but the calendar is too large.

jQuery Datepicker http://www.softcircuits.com/Client/datepicker.png

The site I'm working on has many layers of stylesheets and parent pages and controls. And I don't seem to be able to isolate what is making it large. (Sorry, the site isn't public.)

It appears the calendar is based on a font size. I tried wrapping my textbox in a div with a smaller font but it seems to ignore that. Is there any way to specify a fixed font size?

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

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

发布评论

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

评论(7

耳钉梦 2024-12-02 05:13:15

虽然更改 .ui-widget 的字体大小有效,但我通过以下方式获得了最佳结果。

#ui-datepicker-div { font-size:11px; }

这似乎不仅完全满足了我的需要,而且也不太可能影响任何其他 jquery-ui 小部件。

While changing the font size for .ui-widget works, I got the best results with the following.

#ui-datepicker-div { font-size:11px; }

Not only does this seem to do exactly what I need, it is also unlikely to impact any other jquery-ui widgets.

街角卖回忆 2024-12-02 05:13:15

尝试为 .ui-datepicker 类设置 font-size

.ui-datepicker {font-size:11px;}

http ://jsfiddle.net/pxfunc/ps5cA/

try setting font-size for class .ui-datepicker

.ui-datepicker {font-size:11px;}

http://jsfiddle.net/pxfunc/ps5cA/

花辞树 2024-12-02 05:13:15

这需要对 firebug 进行一些挖掘,但我已经包含了我用来减少它的版本之一。关键是从 jQuery-ui CSS 文件中复制确切的样式,并将它们放在您需要它们的页面的头部或 jQuery-ui 样式表后面的 CSS 样式表中。

.ui-datepicker {
    padding: 0.1em 0.1em 0;
    width: 11em;
}

.ui-widget {
    font-family: Helvetica,Arial,sans-serif;
    font-size: 14px;
}

.ui-datepicker th {
    border: 0 none;
    font-weight: normal;
    padding: 0.2em 0.1em;
    text-align: center;
}

.ui-datepicker th span {
    font-size: 11px;
}

.ui-datepicker td span, .ui-datepicker td a {
    padding: 0.1em;
}

.ui-datepicker td {
    padding: 0.9px;
}

.ui-datepicker .ui-state-highlight {
    height: 12px;
    margin-bottom: 0;
}

.ui-state-default, .ui-widget-content .ui-state-default, 
.ui-widget-header .ui-state-default {
    font-size: 10px;
    font-weight: normal;
    text-align: center;
}

.ui-datepicker .ui-datepicker-title {
    line-height: 13px;
}

.ui-datepicker .ui-datepicker-title span {
    font-size: 11px;
}

.ui-datepicker .ui-datepicker-prev span, 
.ui-datepicker .ui-datepicker-next span {
    margin-left: -8px;
    margin-top: -8px;
}

.ui-datepicker .ui-datepicker-prev, 
.ui-datepicker .ui-datepicker-next {
    height: 15px;
    top: 1px;
    width: 15px;
}

.ui-datepicker-next-hover .ui-icon {
    height: 16px;
    width: 16px;
}

It takes some digging in firebug but I have included one of the versions I use to reduce it. The key is to copy the exact styles from the jQuery-ui CSS file and put them in the head of the page you need them or in a CSS style sheet after the jQuery-ui style sheet.

.ui-datepicker {
    padding: 0.1em 0.1em 0;
    width: 11em;
}

.ui-widget {
    font-family: Helvetica,Arial,sans-serif;
    font-size: 14px;
}

.ui-datepicker th {
    border: 0 none;
    font-weight: normal;
    padding: 0.2em 0.1em;
    text-align: center;
}

.ui-datepicker th span {
    font-size: 11px;
}

.ui-datepicker td span, .ui-datepicker td a {
    padding: 0.1em;
}

.ui-datepicker td {
    padding: 0.9px;
}

.ui-datepicker .ui-state-highlight {
    height: 12px;
    margin-bottom: 0;
}

.ui-state-default, .ui-widget-content .ui-state-default, 
.ui-widget-header .ui-state-default {
    font-size: 10px;
    font-weight: normal;
    text-align: center;
}

.ui-datepicker .ui-datepicker-title {
    line-height: 13px;
}

.ui-datepicker .ui-datepicker-title span {
    font-size: 11px;
}

.ui-datepicker .ui-datepicker-prev span, 
.ui-datepicker .ui-datepicker-next span {
    margin-left: -8px;
    margin-top: -8px;
}

.ui-datepicker .ui-datepicker-prev, 
.ui-datepicker .ui-datepicker-next {
    height: 15px;
    top: 1px;
    width: 15px;
}

.ui-datepicker-next-hover .ui-icon {
    height: 16px;
    width: 16px;
}
泅渡 2024-12-02 05:13:15

将其添加到 site.css 对我有用

.ui-widget {
    font-size: .7em !important;
  }

Adding this to the site.css worked for me

.ui-widget {
    font-size: .7em !important;
  }
吻泪 2024-12-02 05:13:15

您可以更改“jquery-ui-1.10.4.custom.css”如下

.ui-widget
{
    font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
    font-size: 0.6em;
}

you can change "jquery-ui-1.10.4.custom.css" as follows

.ui-widget
{
    font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
    font-size: 0.6em;
}
挽你眉间 2024-12-02 05:13:15

我们的日历又大又丑,月份箭头很难点击。这是由 jquery-ui css 和 jquery-ui js 包含的版本不匹配引起的。

版本号必须匹配,例如

jquery-ui-1.10.3.custom.min.css
jquery-ui-1.10.3.custom.min.js

,但也需要上面推荐的 css

#ui-datepicker-div { font-size:11px; }

Our calendar was big and ugly looking with hard to click month arrows. It was caused by mismatching versions of the jquery-ui css and jquery-ui js includes.

version numbers must match e.g.

jquery-ui-1.10.3.custom.min.css
jquery-ui-1.10.3.custom.min.js

but also needed the css recommended above

#ui-datepicker-div { font-size:11px; }
初雪 2024-12-02 05:13:15

我同意 mdmullinax 的观点。您必须更改整个类的字体大小

.ui-datepicker-div { font-size:11px;因为

datepicker 不受 id 控制,所以下面的更改对大小没有影响

ui-datepicker-div { font-size:11px; }

小时

I agree with mdmullinax. You have to change the font size for the whole class

.ui-datepicker-div { font-size:11px; }

because datepicker is not controlled by id so below change has no impact on size

ui-datepicker-div { font-size:11px; }

h

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