【发布时间】:2016-07-25 18:09:52
【问题描述】:
在日历日期选择器中,我有这个 DIV
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi-2 ui-datepicker-multi">
我想为这个类更改 css 类:
ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi-2 ui-datepicker-multi
我是这样用的,但是不行:
.ui-datepicker .ui-widget .ui-widget-content .ui-helper-clearfix .ui-corner-all .ui-datepicker-multi .ui-datepicker-multi-2 {
position: absolute;
top: 38px;
left: 44px;
z-index: 1;
display: block;
width: 55em;
}
如何更改该类的 css?我的css不正确吗? 这个 DIV 有问题,因为会自动将一种样式添加到 div 中。我检查了检查元素,我看到有内联元素,但没有。这就是为什么CSS不会影响它,如何解决?
How to remove auto style into this div?
我需要有人帮助我完成以下 JavaScript 代码,如何 将宽度设置为 width: "55em" 都是因为以下代码 CSS 不会影响到该 DIV
// determine sizing offscreen
inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px", width: "55em" } );
$.datepicker._updateDatepicker( inst );
// fix width for dynamic number of date pickers
// and adjust position before showing
offset = $.datepicker._checkOffset( inst, offset, isFixed );
inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
left: offset.left + "px", top: offset.top + "px", width: "55em" } );
if ( !inst.inline ) {
showAnim = $.datepicker._get( inst, "showAnim" );
duration = $.datepicker._get( inst, "duration" );
inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
$.datepicker._datepickerShowing = true;
if ( $.effects && $.effects.effect[ showAnim ] ) {
inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
} else {
inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
}
if ( $.datepicker._shouldFocusInput( inst ) ) {
inst.input.trigger( "focus" );
}
$.datepicker._curInst = inst;
}
},
【问题讨论】:
标签: javascript html css datepicker