Results 1 to 3 of 3

Thread: Dynamically change the menu bar color on the Omni Slide Menu

  1. #1
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Dynamically change the menu bar color on the Omni Slide Menu

    1) Script Title: DD Omni Slide Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...lide/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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    you could use the bar text's id to work with it. The id is:

    Code:
    menu_idbar
    For the first demo menu, that would be:

    Code:
    menu1bar
    To elaborate, one could do something like so:

    Code:
    <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>
    Last edited by jscheuer1; 07-08-2008 at 02:13 AM. Reason: add example
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    That's what I wanted to do. Thank You

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •