【发布时间】:2015-11-26 16:47:06
【问题描述】:
有一个input-control 有一个label:
<div class="input-control modern text" data-role="input">
<input name="salle_lib" id="salle_lib" type="text" maxlength="70" placeholder="libellé" data-validate-func="required" data-validate-hint="Ce champ est obligatoire"/>
<button class="button helper-button clear"><span class="mif-cross"></span></button>
<span class="label">libellé</span> // this is the label
</div>
MetroCSS 的默认行为是当点击input-control 时会显示标签:
.input-control.text > .label {
position: absolute;
left: 0;
top: -1rem;
font-size: .875rem;
}
.input-control.modern input:focus ~ .label {
opacity: 1;
-webkit-transform: translateY(-18px);
transform: translateY(-18px);
transition: all 0.3s linear;
}
即使未单击输入控件,我也希望始终显示此标签。我试过$(".input-control.text").click(); 但没用!那么该怎么做呢?
这里是jsfiddle。
【问题讨论】:
-
我在最后的问题中包含了 jsfiddle。
标签: jquery css metro-ui-css