Results 1 to 5 of 5
  1. #1


    Member Since
    Apr 08, 2004
    Posts
    129
    Question Changing DW's dropdown nav background from solid color to an image?
    I'm working on a site with dropdown Javascript navigation creatd by Dreamweaver but instead of using the solid color DW sets for when you rollover one of the menus, I'd like to have an image instead. For example, instead of hovering over a button, having the dropdown appear, and then having the menu items turn green when you mouse over them, I'd like their background to turn to a floral graphic (or something, that's just an example). Is there a simple way to change that in the code? In the Javascript for the dropdown menus, would it be as easy as changing the background color from a hex value to an image path instead?

    Here's a quick example page (page, button, dropdown menu) that I've been playing with to see if I can get a background image on the dropdown menu instead of a color:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function mmLoadMenus() {
      if (window.mm_menu_0130111205_0) return;
      window.mm_menu_0130111205_0 = new Menu("root",107,18,"Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#D6D6D6","http://www.leapfrogit.com/test/button_bkgd.gif","left","middle",3,0,500,-5,7,true,true,true,0,true,true);
      mm_menu_0130111205_0.addMenuItem("About&nbsp;Us","location='index.htm'");
      mm_menu_0130111205_0.addMenuItem("History","location='index.htm'");
      mm_menu_0130111205_0.addMenuItem("Employment","location='index.htm'");
      mm_menu_0130111205_0.addMenuItem("Contact&nbsp;Us","location='index.htm'");
      mm_menu_0130111205_0.addMenuItem("Sitemap","location='index.htm'");
       mm_menu_0130111205_0.hideOnMouseOut=true;
       mm_menu_0130111205_0.bgColor='#D6D6D6';
       mm_menu_0130111205_0.menuBorder=1;
       mm_menu_0130111205_0.menuLiteBgColor='#D6D6D6';
       mm_menu_0130111205_0.menuBorderBgColor='#000000';
    
    mm_menu_0130111205_0.writeMenus();
    } // mmLoadMenus()
    
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    <script language="JavaScript" src="mm_menu.js"></script>
    </head>
    
    <body onLoad="MM_preloadImages('button_RO.jpg')">
    <script language="JavaScript1.2">mmLoadMenus();</script>
    <div align="center">
      <p>&nbsp;</p>
    
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p><a href="index.htm" onMouseOut="MM_swapImgRestore();MM_startTimeout();" onMouseOver="MM_swapImage('button','','button_RO.jpg',1);MM_showMenu(window.mm_menu_0130111205_0,0,40,null,'button')"><img src="button.jpg" alt="BUTTON SMASH!" name="button" width="200" height="40" border="0"></a></p>
    </div>
    </body>
    </html>
    Thanks,
    m19

  2. #2


    Member Since
    Apr 08, 2004
    Posts
    129
    Anyone?

    m19

  3. #3
    MadRhino23
    Guest
    Is that the entire script? If not please send it to me ( admin@northcoastdesign.com)... There is a way I am sure!

    Gregg :mail: :mail:

  4. #4


    Member Since
    Apr 08, 2004
    Posts
    129
    Talking
    Quote Originally Posted by MadRhino23
    Is that the entire script? If not please send it to me ( admin@northcoastdesign.com)... There is a way I am sure!

    Gregg :mail: :mail:
    Thanks Gregg! I've been searching since yesterday for some way to do a graphic background *without* having to do all the menus over again, and I'm starting to lose hope. I'll be sending an email your way momentarily.

    (EDIT-) Okay, I just sent you an email.

    Thanks,
    m19

  5. #5


    Member Since
    Apr 08, 2004
    Posts
    129
    Talking
    Gregg,

    Have you had any luck looking at the files?

    m19

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HTML body background-color shows in front of image since iOS 7
    By aurur in forum Web Design and Hosting
    Replies: 3
    Last Post: 10-02-2013, 10:41 AM
  2. Replacement LCD not working, getting blur ( not solid color )
    By exiphone in forum iPhone Hardware and Accessories
    Replies: 0
    Last Post: 08-17-2012, 02:01 PM
  3. Changing background color of finder
    By chourreau in forum OS X - Operating System
    Replies: 2
    Last Post: 11-25-2011, 05:45 PM
  4. Changing entire button background color
    By SoulRed12 in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 05-20-2010, 03:51 PM
  5. Replies: 1
    Last Post: 02-23-2006, 11:03 PM

Posting Permissions

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