jQuery DatePicker 太大
我已经实现了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
虽然更改
.ui-widget
的字体大小有效,但我通过以下方式获得了最佳结果。这似乎不仅完全满足了我的需要,而且也不太可能影响任何其他 jquery-ui 小部件。
While changing the font size for
.ui-widget
works, I got the best results with the following.Not only does this seem to do exactly what I need, it is also unlikely to impact any other jquery-ui widgets.
尝试为
.ui-datepicker
类设置font-size
http ://jsfiddle.net/pxfunc/ps5cA/
try setting
font-size
for class.ui-datepicker
http://jsfiddle.net/pxfunc/ps5cA/
这需要对 firebug 进行一些挖掘,但我已经包含了我用来减少它的版本之一。关键是从 jQuery-ui CSS 文件中复制确切的样式,并将它们放在您需要它们的页面的头部或 jQuery-ui 样式表后面的 CSS 样式表中。
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.
将其添加到 site.css 对我有用
Adding this to the site.css worked for me
您可以更改“jquery-ui-1.10.4.custom.css”如下
you can change "jquery-ui-1.10.4.custom.css" as follows
我们的日历又大又丑,月份箭头很难点击。这是由 jquery-ui css 和 jquery-ui js 包含的版本不匹配引起的。
版本号必须匹配,例如
,但也需要上面推荐的 css
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.
but also needed the css recommended above
我同意 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