【发布时间】:2013-12-12 13:56:32
【问题描述】:
我需要什么:一个 jQuery UI 框架按钮,可以在此处找到:http://jqueryui.com/themeroller/(查看框架图标)在 jQuery 手风琴标题中。
现场样例:http://www.nikollr3.three.axc.nl/
(据我了解;一个按钮也可以通过带有正确 jQuery UI 类的 Achor 标签来模仿。)
要求: 我不希望在当前未选择标题时显示按钮/图标。另一方面,如果选择了标题,因此也显示了它的 DIV,我希望显示图标/按钮。看左边的第一张图片,在那种状态下,我不想显示“+”按钮。在所有其他图像(聚焦/选择的地方)中,我确实希望显示它。目前尚未实施;如何做到这一点?
-> 如果单击按钮,我希望显示 statProp,为此我有一个函数 showStatProp()。
我目前遇到的问题: 悬停在“按钮上”不是做任何,因为当前选择标题时,同样的CSS是以某种方式应用于标题的按钮(看按钮的横向颜色:黑暗灰色到黑色)(没有单独的悬停)。
如何做到这一点?我目前陷入困境,因为在互联网上找到的关于我正在尝试的特定事情的文档/信息有限。
function showStatProp()
{
if(document.getElementById("statProp").style.display == "none")
{
document.getElementById("statProp").style.display = 'block';
}
else
{
document.getElementById("statProp").style.display = 'none';
}
}
HTML:
<body onkeydown="controlCheck(event)" onkeyup="clearPress()" >
<div id="application" style="position:absolute">
<div id="accordion">
<h3 id="clickStat">Stations
<span style="float:right;" class="ui-state-default ui-corner-all">
<a class="ui-icon ui-icon-plusthick btpad" href="/getPunten.php">Edit</a>
</span></h3>
<div id="stations">
<input type="text" id="stations_ac" onclick="this.value='';" />
<div id="selectedStationDiv">
</div>
<hr>
<div id="statProp" style="display:none;">
<p>Name: <input type="text" style="float:right; clear:right" size="19" id="statNam" onclick="this.value='';" /></p>
<p style="margin-top:15px">
Type:
<select id ="statTyp" style ="float:right" onchange="">
<option></option>
<option title="Test">T</option>
</select>
</p>
<p style="margin-top:15px">
Admtyp:
<select id ="admtyp" style ="float:right" onchange="FilterByToestanden()">
<option></option>
<option title="Alarm">A</option>
<option title="Alarm">D</option>
<option title="Urgent alarm">U</option>
</select>
</p>
<p>Image: <input type="text" id="statBildnam" size="12" style ="float:right;text-transform: uppercase"></p>
<p id="devText">Text:
<input type="text" style="float:right; clear:right" id="texts_ac" onclick="this.value='';" /></p>
<p>
<p id ="respLine">Responsible: <select id="statResp" style="margin-bottom:10px;margin-top:6px;"><option>WERKHUIS-EMG-WEVELGEM</option></select></p>
<button id="btnCrtStat" onClick="createStation()" type="button" style="margin-left:26px;margin-top:-3px">Create</button>
</div>
</div>
<h3 id="clickImages" onclick="listImages()">Images</h3>
<div id="imagesList" style="overflow:auto">
<ul id='imagesUL'></ul>
<button onClick="addImage()" type="button" style="margin-left:26px;margin-top:-3px">Add image</button>
</div>
【问题讨论】:
-
一个活生生的例子会很有帮助
-
@ZachSaucier 任何提示都将不胜感激
-
我不太能够理解您的问题以帮助您(并假设其他人)。您能否通过“我不希望当前未选择标题时显示按钮/图标”来扩展您的意思。是否有机会绘制您想要的最终解决方案的线框?
-
@Hady 看看左边的第一张图片,在那个统计中我不想显示“+”按钮。在所有其他图像(聚焦/选择的地方)中,我确实希望显示它。
标签: javascript jquery html css jquery-ui