javascript - How to change this specific css class inside div, in Date Picker jquery-ui? -
in calendar date picker, have 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">
i want change css class class:
ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi-2 ui-datepicker-multi
i used this, doesn't work:
.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; }
how change css class? css incorrect? there's wrong div, because 1 style automatically added div. checked inspect element, saw there's element inline, there's non. that's why css won't affect it, how solve it?
i need me following javascript code, how set width width: "55em" because of following code css won't affect div
// determine sizing offscreen inst.dpdiv.css( { position: "absolute", display: "block", top: "-1000px", width: "55em" } ); $.datepicker._updatedatepicker( inst ); // fix width dynamic number of date pickers // , 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; } },
you need not have spaces in-between classes. when have spaces, target each class if child of 1 before it. removing spaces target elements have of classes in one.
.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: 70em; }
edit: in order override inline styles, use jquery's .css()
function set style of element want. this:
$('#ui-datepicker-div').css('width':'70em');
Comments
Post a Comment