Hi,
I am trying to change the backcolor and forecolor on mouseover and mouseout events. But it throws javascript error for LinkElement.
I had done the same for RadMenu for ASP.Net and its working fine. But this is not working for AJAX Menu.
The error shown is Item.LinkElement is null or not an object
Note:- Why am not using css for this is coz i will be knowing the colors only at runtime.
<script language="javascript" type="text/javascript">
var oldItemForeColor = "";
var oldItemBGColor = "";
function clientMouseOver(sender, eventArgs)
{
var linkElement = eventArgs.Item.LinkElement;
oldItemForeColor = linkElement.style.color;
oldItemBGColor = linkElement.style.backgroundColor;
linkElement.style.color = "<%= MenuBackColor%>";
linkElement.style.backgroundColor = "<%= MenuForeColor%>";
}
function clientMouseOut(sender, eventArgs)
{
var linkElement = eventArgs.Item.LinkElement;
linkElement.style.color = oldItemForeColor;
linkElement.style.backgroundColor = oldItemBGColor;
}
</script>
Please help.
Thanks & Regards
Sujith
I am trying to change the backcolor and forecolor on mouseover and mouseout events. But it throws javascript error for LinkElement.
I had done the same for RadMenu for ASP.Net and its working fine. But this is not working for AJAX Menu.
The error shown is Item.LinkElement is null or not an object
Note:- Why am not using css for this is coz i will be knowing the colors only at runtime.
<script language="javascript" type="text/javascript">
var oldItemForeColor = "";
var oldItemBGColor = "";
function clientMouseOver(sender, eventArgs)
{
var linkElement = eventArgs.Item.LinkElement;
oldItemForeColor = linkElement.style.color;
oldItemBGColor = linkElement.style.backgroundColor;
linkElement.style.color = "<%= MenuBackColor%>";
linkElement.style.backgroundColor = "<%= MenuForeColor%>";
}
function clientMouseOut(sender, eventArgs)
{
var linkElement = eventArgs.Item.LinkElement;
linkElement.style.color = oldItemForeColor;
linkElement.style.backgroundColor = oldItemBGColor;
}
</script>
Please help.
Thanks & Regards
Sujith