改变背景图片,求高手解救!
.menuGroupTitle {
margin-top:1px;
padding-top: 6px;
text-indent:5px;
font-size:12px;
font-weight:bold;
background: #ffffff url(images/index/left/MenuTitleBackground.jpg) repeat-y
bottom;
height:25px;
cursor:hand;
}
.menuGroupTitleonclick {
margin-top:1px;
padding-top: 6px;
text-indent:5px;
font-size:12px;
font-weight:bold;
background: #ffffff url(images/index/left/MenuTitleBackgro.jpg) repeat-y bottom;
height:25px;
cursor:hand;
}
]]>
xsl:for-each select="*">
<![CDATA[<div class="mainMenu">]]>
<![CDATA[<div class="mainMenuTitle"></div>]]>
<![CDATA[<ul>]]>
<xsl:for-each select="MenuItem">
<![CDATA[<li class="menuGroup">]]>
<![CDATA[<div id="menuGroupTitle_]]><xsl:value-of select="@name"/><!
[CDATA[" class="menuGroupTitle" onclick="javascript:menuToggle(']]><xsl:value-of select="@name"/><!
[CDATA[')"><img src="]]><xsl:value-of select="@icon"/><![CDATA[" /> ]]><xsl:value-of
select="@label"/><![CDATA[</div>]]>
<![CDATA[<ul id="menuGroupUL_]]><xsl:value-of select="@name"/><![CDATA
[">]]>
<xsl:for-each select="MenuItem">
<![CDATA[<li class="menuItem">]]>
<![CDATA[<img src="images/index/left/document_small.png"><a
target="OAFrame" href="]]><xsl:value-of select="@href"/><![CDATA[">]]><xsl:value-of
select="@label"/><![CDATA[</a>]]>
<![CDATA[</li>]]>
</xsl:for-each>
<![CDATA[</ul>]]>
<![CDATA[</li>]]>
</xsl:for-each>
<![CDATA[</ul>]]>
<![CDATA[</div>]]>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<script type="text/javascript">
function menuToggle(menuID) {
$('.menuGroup > ul').not($('#menuGroupUL_' + menuID)).css('display','none');
$('#menuGroupUL_' + menuID).toggle(200);
}
</script>
怎么在menuToggle里面写方法 改变$('#menuGroupUL_' + menuID)的背景图片;
我这一些不行啊, 求高手解救!!
function menuToggle(menuID) {
$('.menuGroup > ul').not($('#menuGroupUL_' + menuID)).css('display','none');
<!--$('menuGroupTitle_' + menuID).css('background-image')=='url(images/index/left/MenuTitleBackgro.jpg)';-->
if ($('#menuGroupUL_' + menuID).css('display') != 'none') {
if ($('#menuGroupUL_' + menuID).css('display') == 'block') {
$('menuGroupUL_' + menuID).classNma="menuGroupTitleonclick";
alert('11');
}
$('#menuGroupUL_' + menuID).toggle(200);
}
------解决方案--------------------
用 firebug 调试下。