我有以下函数,在将input元素包装到$(...)中之后,动态创建date类型的the元素。
function addDatePicker(jQueryObject) {
jQueryObject.datepicker({
showOn: "button",
buttonImage: urlToImage,
buttonImageOnly: true,
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
yearRange: "c-10:c+10",
showButtonPanel: true
});
}在查看Chrome中的页面元素时,我可以看到hasDatePicker类被正确地添加到input标记中。但是,包含按钮的img标记是而不是添加的。
我做错了什么?input标记位于td标记中。这可能是原因吗?
发布于 2013-07-29 10:18:57
检查您的图像URL或使用img url (http://jqueryui.com/resources/demos/datepicker/images/calendar.gif)
检查http://jsfiddle.net/cvPCL/上的工作代码
buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",https://stackoverflow.com/questions/17911875
复制相似问题