我想实现类似于新鲜事的功能,因此想把一部分消息隐藏起来。第一个div标签里面的id是唯一的,第一个子div中为默认显示的第一条,点击按钮就会展开所有的新鲜事。用tapestry写的
<t:block t:id="showGroupNotificationBlock">
<div id="${showGroupNotification.groupNotification.get(0).sourceId}">
<div style="dispaly:block;" id="oneNews">
<t:loop source="showGroupNotification.groupNotification.get(0)" value="showNotification" showNotification="showNotification" index="var:index">
<t:delegate to="chooseGroupBlock" /> 
${showNotification.id}
</t:loop>
<a class="label pull-right" href="javascript:displayShowUI(${showGroupNotification.groupNotification.get(0).sourceId})">show</a>
</div>

<div style="display:none" id="groupNews" >
<t:loop source="showGroupNotification.groupNotification" value="showNotification" showNotification="showNotification" index="var:index">
<t:delegate to="chooseGroupBlock" /> 
${showNotification.id}
</t:loop>
</div>
</div>
</t:block>后台的.js我是这么写的,但是根本没有效果啊...function displayShowUI(id)
{
var ui = jQuery("#"+id).find("div");
        ui.find(".oneNews").hide();
ui.find(".groupNews").show();
}
本来直接用下面这一段代码是可行的,但是因为没有加上唯一的标签,所以只能搜索到的第一个div。function displayShowUI(id){
var ui = document.getElementById(oneNews);
        ui.style.display = none;
        var vi = document.getElementById(groupNews);
        vi.style.display = block;
}
菜鸟一枚,求指导!!!