PDA

View Full Version : Dynamically change the menu bar color on the Omni Slide Menu



tomus
07-07-2008, 04:22 PM
1) Script Title: DD Omni Slide Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm

3) Describe problem: I would like to dynamically change the color of the menu bar that is visible based on some user actions/event. I've been able to change non-header background color dynamically using background-color. Any advise would be appreciated.

jscheuer1
07-07-2008, 11:57 PM
you could use the bar text's id to work with it. The id is:


menu_idbar

For the first demo menu, that would be:


menu1bar

To elaborate, one could do something like so:


<script type="text/javascript">
function juice_bar(){
var bar = document.getElementById('menu1bar');
bar.onmouseover = function(){bar.style.backgroundColor = 'red';};
bar.onmouseout = function(){bar.style.backgroundColor = '';};
}
if(typeof window.addEventListener!='undefined')
window.addEventListener('load', juice_bar, false);
else if(typeof window.attachEvent!='undefined')
window.attachEvent('onload', juice_bar);
</script>

tomus
07-09-2008, 03:43 PM
That's what I wanted to do. Thank You :)