1
我在写一个XSL文件,其中包含一个包含链接列表的side-nav菜单。当用户点击其中一个链接时,页面跳转到该链接的相应信息表。我该如何做到这一点,以便当点击链接时,该表的标题(而不是链接本身)被突出显示?它也应该取消突出显示是否点击了另一个链接。如何突出显示点击链接的相应标题?
这里是链接的菜单:
<div onclick = "highlight(this);" onblur = "undoHighlight(this);">
<a href = "#{generate-id(.)}">
<xsl:value-of select = "."/> (<xsl:value-of select = "count(../n1:entry)"/>)
</a>
</div>
这是JavaScript的亮点/ undoHighlight功能:
function highlight(link)
{
undoHighlight(link)
link.style.background = "red";
}
function undoHighlight(link)
{
link.style.background = "white";
}
任何帮助,将不胜感激。提前致谢!
编辑:这里是我提供的使用jQuery突出到菜单样本输出页的表
<!-- Component/Section -->
<xsl:template match="n1:component/n1:section">
<xsl:apply-templates select="n1:title"/>
<xsl:apply-templates select="n1:text"/>
<xsl:apply-templates select="n1:component/n1:section"/>
</xsl:template>
<!-- Title -->
<xsl:template match="n1:title">
<div id = "dataTitleStyle">
<a name="{generate-id(.)}"><xsl:value-of select="."/></a>
</div>
</xsl:template>
<!-- Text -->
<xsl:template match="n1:text">
<xsl:apply-templates />
</xsl:template>
你能给你提到的表的例子(无论是HTML,或用于构建他们XSLT?) – 2010-04-29 08:45:03
编辑,以显示表格布局(: – danielle 2010-05-09 21:44:17