日历控件在页面上加载的时候背景是透明的,求大神帮忙看看

qq_38055744 2017-03-25 12:11:17
HTML代码:
 注册时间: <input type="text" class=" calendar" id="reg_time_gt" name="reg_time_gt" onclick="showCalendar('reg_time_gt','%Y-%m-%d',false,false,'reg_time_gt')" />

js方法:
function showCalendar(id, format, showsTime, showsOtherMonths, selbtn) {

var el = typeof(id) == "object" ? id : document.getElementById(id);
if (selbtn == '')
{
selbtn = 'selbtn';
}
var btn_el = typeof(selbtn) == "object" ? selbtn : document.getElementById(selbtn);;
if (_dynarch_popupCalendar != null) {
// we already have some calendar created
_dynarch_popupCalendar.hide(); // so we hide it first.
} else {
// first-time call, create the calendar.
var cal = new Calendar(1, null, selected, closeHandler);

// uncomment the following line to hide the week numbers
// cal.weekNumbers = false;
if (typeof showsTime == "string") {
cal.showsTime = true;
cal.time24 = (showsTime == "24");
}
if (showsOtherMonths) {
cal.showsOtherMonths = true;
}
_dynarch_popupCalendar = cal; // remember it in the global var
cal.setRange(1900, 2070); // min/max year allowed.
cal.create();
//alert(cal.table.parentNode.parentNode.innerHTML);

}
_dynarch_popupCalendar.setDateFormat(format); // set the specified date format
_dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field
_dynarch_popupCalendar.sel = el; // inform it what input field we use
//_dynarch_popupCalendar.btn = btn_el; //

// the reference element that we pass to showAtElement is the button that
// triggers the calendar. In this example we align the calendar bottom-right
// to the button.
//_dynarch_popupCalendar.showAtElement(el.nextSibling, "Br"); // show the calendar
_dynarch_popupCalendar.showAtElement(btn_el, "Br");
return false;
}

CSS样式:
.calendar, .calendar table {
border: 1px solid #bdb2bf;
font-size: 11px;
color: #000;
cursor: default;
background: url("normal-bg.gif");
font-family: "trebuchet ms",verdana,tahoma,sans-serif;
}
...全文
136 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_38055744 2017-03-25
  • 打赏
  • 举报
回复
求大神帮我看看

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧