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

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.

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


For the first demo menu, that would be:


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);

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