I have 5 items in my webdatamenu when I hover it changes the colour to what I want. but when I click on the menu item I get my page - but menu colour defaults.
I want menu item to stay changed colour. so user can know what page / link he is on..
any ideas?
Hello Jagjot,
WebDataMenu features css classes and properties for styling the selected and active items, however the control is configured to remove the selection styling after the focus is lost. Therefore I would suggest manually handling the ItemClicked clientside event in order to apply (and remove) a selection class on the clicked item as such:
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.7.2.min.js"></script> <script type="text/javascript" id="igClientScript"> <!-- var lastItemElement; function WebDataMenu1_ItemClick(sender, eventArgs) { if (lastItemElement != null) { $(lastItemElement).removeClass("selectedItem"); } lastItemElement = eventArgs.getItem().get_element(); $(lastItemElement).addClass("selectedItem"); //Add code to handle your event here. }// --> </script>
Hope this helps. Please feel free to contact me if you have any questions.
Please do not hesitate to contact me if you have any further questions regarding this matter.