jQuery UI 日期选择器显示无动作 [英] jQuery UI datepicker display without action

查看:26
本文介绍了jQuery UI 日期选择器显示无动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在无需单击任何内容的情况下显示 jQuery UI 日期选择器?我希望日期选择器在窗口加载时可见.或者这是不可能的?如果没有,是否有其他插件或最好自己创建一个新插件?

Is it possible to display jQuery UI datepicker without having to click on anything? I want the datepicker to be visible when the window loads. Or is this not possible? If not is there another plugin for this or is it best to create a new on my own?

推荐答案

您可以做的一件事是将焦点放在输入上,以便日期选择器显示:

one thing you could do is give focus to the input so that the datepicker shows:

 $('#datepicker').focus()

看这里http://jsbin.com/agazes/edit#preview

或创建后显示:

 $('#datepicker').datepicker('show')

http://jsbin.com/agazes/2/edit#preview

这篇关于jQuery UI 日期选择器显示无动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆