Apply different CSS to different jQuery datepickers

只愿长相守 提交于 2020-01-14 14:12:08

问题


I have several datepickers tied to input fields. They are created in the usual way:

$('#input1').datepicker(options1);
$('#input2').datepicker(options2);

Now I want to style them differently for each field. But when inspecting the page in Firefox, I see that each datepicker is a div with the same id: ui-datepicker-div! And they aren't descendants or siblings of input fields, so I don't see a way to use the inputs' ids in CSS selectors.


回答1:


I think that you'll have to use beforeShow or some other callback or event to modify the datepicker dynamically. You don't posted more details about options1 and options2 which you use. Probably you will have to solve more additional problems.



来源:https://stackoverflow.com/questions/9902367/apply-different-css-to-different-jquery-datepickers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!