how do I link an anchor to a sub menu

Discussion in 'Web Design and Development' started by knumme13, Mar 9, 2009.

  1. knumme13 macrumors newbie

    Joined:
    Feb 12, 2009
    #1
    I created a drop down sub menu in fireworks mx which works great. But now i have to link each item in sub menu(drop down) to an anchor on a page in my dreamweaver mx file. I can link a to a page using it's url but can I link to an anchor? I hope so otherwise I'm in trouble!!!
    thank you for the help
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    It should work fine simply to use "#anchor_name". And if you find for some reason it doesn't work then you can use Javacript to jump to an anchor point via: location.hash = 'anchor_name';

    If using XHTML strict 1.0 use "<a id='anchor_name' />" otherwise for all other DTD's use "<a name='anchor_name'></a>" when defining your anchors.

    -jim
     
  3. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #3
    still not working

    I put <a name='anchor_name'> in my dreamweaver code.
    I'm using the pop up menu editor in fireworks to create sub menu: I wrote in the link box: #anchor_rosacea and doesn't work.

    do I insert this code location.hash = 'anchor_name'
    in dreamweaver??or the pop up menu editor?
     
  4. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #4
    Did you actually put <a name='anchor_name'> in the page, or did you put <a name='anchor_rosacea'>? Sorry if it sounds like a dumb question, I've just learned long ago not to assume something that seems obvious to me.

    jW
     
  5. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #5
    dreamweaver mx code <a name="anchor_rosacea">
    fireworks mx script. javascript:;location.hash = anchor_'rosacea'
     
  6. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #6
    First thing I'm noticing is that the quotes around 'rosacea' need to be around the entire anchor name (i.e. 'anchor_rosacea'). As for the rest of the syntax on that JS, I'm actually not quite sure, but try that change, since I know that needs to be fixed.

    jW
     
  7. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #7
    <a name='anchor_rosacea'> the dreamweaver mx code
    "#anchor_rosacea" put this in fireworks pop up menu editor.

    still not working...
     
  8. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #8
    Do you have a link to the page? It'll make troubleshooting this a lot easier.

    jW
     
  9. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #9
    link to page
    http://www.hollywoodstaging.com/paradigm106.htm

    go to skin problems & solutions on nav bar and click on rosacea in sub menu
    I got it to go to the page not the anchor in fireworks mx but when I uploaded it it would not even go to the skin problems page.
     
  10. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #10
    Is the anchor supposed to be on that same page? I don't see either the anchor nor the link to it on that page.

    jW
     
  11. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #11
    update:

    I got it to work when i preview in browser from my fireworks mx file.I changed link in pop up menu editor to http://www.hollywoodstaging.com/skinproblems&solutions.htm#anchor_rosacea

    The anchor is supposed to be on the skinproblems& solutions.htm page not on the paradigm106.htm page.

    the skin problems & solutions button shouldn't link you should only link to anchors on sub menu which should go to anchors onskin problems & solutions page.

    I upload new file.
    still not working in ie or firefox on mac
     
  12. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #12
    update again

    Should I be changing the code in my Paradigm106.htm page in dreamweaver so sub menu will get me to my anchors on skin problems & Solutions page...

    <script language="JavaScript">
    <!--
    function mmLoadMenus() {
    if (window.mm_menu_0219235613_0) return;
    window.mm_menu_0219235613_0 = new Menu("root",164,20,"Verdana, Arial, Helvetica, sans-serif",12,"#ffffff","#ffffff","#000000","#999999","left","middle",0,0,1000,-5,7,true,false,true,0,false,false);
    mm_menu_0219235613_0.addMenuItem("skin aging & wrinkling");
    mm_menu_0219235613_0.addMenuItem("skin cancer");
    mm_menu_0219235613_0.addMenuItem("enlarged pores");
    mm_menu_0219235613_0.addMenuItem("age/brown spots");
    mm_menu_0219235613_0.addMenuItem("rosacea");
    mm_menu_0219235613_0.addMenuItem("hyperpigmentation");
    mm_menu_0219235613_0.addMenuItem("melasma");
    mm_menu_0219235613_0.addMenuItem("eczema psoriasis");
    mm_menu_0219235613_0.fontWeight="bold";
    mm_menu_0219235613_0.hideOnMouseOut=true;
    mm_menu_0219235613_0.menuBorder=0;
    mm_menu_0219235613_0.menuLiteBgColor='#ffffff';
    mm_menu_0219235613_0.menuBorderBgColor='#555555';
    mm_menu_0219235613_0.bgColor='#555555';

    mm_menu_0219235613_0.writeMenus();
    } // mmLoadMenus()

    //-->
    </script>
     
  13. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #13
    See, the problem here is that the code you're posting doesn't contain a link. Either the link is somewhere else, or you're not getting it into your code. Don't take this the wrong way, but I'm guessing you don't know HTML? You'll need to make some changes in this page and you may not be able to just type stuff into Fireworks.

    BTW, I know you're new to this, but that means it's a good time to learn: menus like this are far better done with CSS and text links, instead of images. Images like that slow down the page significantly, and complicate your website structure with a bunch of images (in this case with weird names like images/paradigm106_r14_c9.jpg). If you need help, try taking a look over this guide at A List Apart. If you need more basic help, take a look at the sticky at the top of this forum. Lots of good links there to help you learn HTML and CSS the right way. Trust me, it's worth it.

    jW
     
  14. knumme13 thread starter macrumors newbie

    Joined:
    Feb 12, 2009
    #14
    thank you for the insight. Only problem is that I have designed a site with 21 pages,photos,text,multimedia. I cannot start over at this point. I did the pop up menu using text in fireworks mx. Are you saying it is not possible to link to the anchors in dreamweaver mx. There is no way to correct the code in dreamweaver to make it work. Apparently there is no problem linking to pages but links to anchors are a different story.
     
  15. logomentum macrumors newbie

    Joined:
    Apr 17, 2009
    Location:
    North Carolina
    #15
    If I'm understanding this correctly, this actually way more simple to do than you may realize. In Fireworks, when you go to the "edit drop down menu" window, simply type in the url this way: mywebsite/#anchortextname

    After the url you add # (number sign) and then the name of the anchor text on that Dreamweaver page. That's it. It will go to the anchor text on that page.
     

Share This Page