我制作了一个小日历应用程序,其中可以添加带有开始日期和重复设置的事件。因此,它可以每天,每周或每月发生。如果您选择每日重复,则在此代码段中可以看到文本。
现在我想知道是否可以将Datefield样式设置为仍然具有dropdown-datepicker的普通段落。我该怎么办?
function rrendClose() {
document.getElementById('dailyText').innerText = "Takes place every day.";
document.getElementById('dailyEnddate').style.visibility = "collapse";
document.getElementById('dailyDismiss').style.visibility = "collapse";
document.getElementById('showFullDaily').style.visibility = "visible";
}
function rrendOpen() {
document.getElementById('dailyText').innerText = "Takes place every day, until";
document.getElementById('dailyEnddate').style.visibility = "visible";
document.getElementById('dailyDismiss').style.visibility = "visible";
document.getElementById('showFullDaily').style.visibility = "collapse";
}
<div class="row">
<p class="pt-1"><p class="ml-3" id="dailyText">Takes place evry day, until</p>
<a id="showFullDaily" class="link" onclick="rrendOpen();" style="visibility: collapse;" >Add enddate</a>
<input name="rrend" class="col-5 form-control border border-dark auto-date" type="date" id="dailyEnddate" value="{{date("d.m.Y")}}">
<button type="button" id="dailyDismiss" class="close col-1" aria-label="Close" onclick="rrendClose();">
<span aria-hidden="true">×</span>
</button></p>
</div>
答案 0 :(得分:1)
一些更改:
showFullDaily
已切换为使用display
属性而不是visibility
,因为后者虽然可见地隐藏了元素,但保留了文本应留的空间,而显示却没有。 / li>
dailyText
从p
标记更改为span
,因为1)p
标记不应相互嵌套,而2)span
是一个内联元素,因此它自然可以继续进行流程而无需其他样式。所有这些更改一起使输入元素可以折叠并随段落流动。
function rrendClose() {
document.getElementById('dailyText').innerText = "Takes place every day.";
document.getElementById('dailyEnddate').style.visibility = "collapse";
document.getElementById('dailyDismiss').style.visibility = "collapse";
document.getElementById('showFullDaily').style.display = "block";
}
function rrendOpen() {
document.getElementById('dailyText').innerText = "Takes place every day, until";
document.getElementById('dailyEnddate').style.visibility = "visible";
document.getElementById('dailyDismiss').style.visibility = "visible";
document.getElementById('showFullDaily').style.display = "none";
}
#dailyEnddate {
border: none;
padding: 0;
font-family: inherit;
font-size: inherit;
}
<div class="row">
<p class="pt-1"><span class="ml-3" id="dailyText">Takes place evry day, until</span>
<a id="showFullDaily" class="link" onclick="rrendOpen();" style="display: none;" >Add enddate</a>
<input name="rrend" class="col-5 form-control border border-dark auto-date" type="date" id="dailyEnddate" value="{{date("d.m.Y")}}">
<button type="button" id="dailyDismiss" class="close col-1" aria-label="Close" onclick="rrendClose();">
<span aria-hidden="true">×</span>
</button></p>
</div>
答案 1 :(得分:0)
转到CSS并输入:
declare evid integer;
declare cur cursor;
evid = 1;
open cur
//Do Insert Into
//Evid +1;
Close cur;