我有一个动态填充的手风琴。在用作触发器的 h2 中,有几个字段是隐藏的,只有在单击“编辑”图标时才会显示。
这是我的问题:当我单击 h2 (任何地方)时,它不仅会打开面板(这是适当的),还会使编辑字段可见。
我怎么只让 h2 的文本成为触发器?
代码(修改):
<h2><span class="heading_span"><?=$oResource->section_order?>. </span>
<?=$oResource->name?> <span class="note">(Section)</span>
<a onclick="$resources.deleteResource(<?=$oResource->id?>)" href="Javascript:;" title="Delete this section" class="delete-resource" style="display: inline">
<img src="/public/images/icons/delete.gif"">
</a>
<a onclick="$compass.resources.showEdit(<?=$oResource->id?>)" href="Javascript:;" title="Edit this section" class="edit-resource" style="display: inline">
<img src="/public/images/icons/pencil.gif"">
</a>
<span id="edit-resource-<?=$oResource->id?>" style="display: none;">
<span class="note">Order:</span>
<select name="section-order-id-<?=$oResource->id?>" id="section-order-id-<?=$oResource->id?>" >
<?= printOptions(Models\Core\resource::optionArrayList('section',''), array('selected'=>$oResource->section_order) ); ?>
</select>
<input type="text" placeholder="New Section Name"/>
<button type="button" onclick="$resources.edit(<?=$oResource->id?>,<?=$oResource->section_order?>,'<?=$oResource->name?>','<?=$oResource->type?>',''); return false;">Save</button>
<img src="<?=$oTheme->getUrl ()?>/ajax_loading_small.gif" alt="" id="loading-<?=$oResource?>" style="display: none;"/>
</span>
然后所有的部分项目都在下面......