Need suggestion to revert colours in menu
HI,
Am new to XSL and have been given the task to do enhancement on an existing XSL project. The issue is I have a button called County which when clicked pops out a window showing a list of countriesâ¦Now when I select a country say âAMERICAâ it gets high lightened from light blue(#E7EBF6) to a dark blue(#A9C4EF'). It works fine.But now when I select the next country in the list say âEUROPEâ this also gets high lightened listing its branches. Now the issue is I canât get the previous country to return to normal i.e to light blue when âEUROPEâ is selected, and on every âonClickâ all the countries are high lightened, is there a way to revert back the other options to normal and high lightened the currently selected one. Before this function was working fine with âonMouseOverâ and âonMouseOutâ which I have changed to âonClickâ.I have hereby enclosed the xsl code. When the âonMouseOutâ function is replaced by âonClickâ it doesnât revert back to the normal colour.The P7_Auto layers function used in the code is to just pop-out the window.
<!-- //************************************************** **********
XSL: /xsl/common/regionLayer.xsl
Version : V1.00
************************************************** **********//-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="regionLayer">
<style>
div#regionLayer {position:absolute; left:8px; top:165px; width:101px; height:97px; z-index:4; visibility: hidden"}
</style>
<div style="position:absolute; left:8px; top:165px; width:101px; height:97px; z-index:4; visibility: hidden"><xsl:attribute name="id">regionLayer</xsl:attribute>
<table border="0" cellspacing="0" cellpadding="1" width="135" bgcolor="000000">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="136">
<xsl:for-each select="//country_biz_nav/region">
<xsl:if test="count(./*/countrytext[text() != 'disable']) > 0">
<tr>
<td bgcolor="#E7EBF6" nowrap="nowrap" class="leftLayerFont11">
<xsl:attribute:name="onClick">this.bgColor='#A9C4E F';style.fontWeight='bold';P7_autoLayers(1,'region Layer'<xsl:if test="country!=''">,'countryLayer_<xsl:value-of select="position()" />'</xsl:if>)</xsl:attribute>
<xsl:attribute:name="onMouseOut">this.bgColor='#E7 EBF6';style.fontWeight='normal'</xsl:attribute>
<xsl:attribute name="id">region_<xsl:value-of select="position()"/></xsl:attribute>
<img src="/scybernet2/image/spacer.gif" width="19" height="18" align="absmiddle"/>
<a href="javascript:;" class="leftLayerFont11" id="layerLinks">
<xsl:if test="country!=''">
<xsl:attribute name="onClick">P7_autoLayers(1,'regionLayer','coun tryLayer_<xsl:value-of select="position()" />')</xsl:attribute>
</xsl:if>
<xsl:value-of select="regiontext" />
</a>
</td>
</tr>
<xsl:if test="position() != last ()">
<tr>
<td bgcolor="#FFFFFF" height="1"></td>
</tr>
</xsl:if>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</table>
</div>
</xsl:template>
</xsl:stylesheet>
|