div tag and dynamic menus

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default div tag and dynamic menus

    Yeah, its me again. Looking for help. I have this menu that I created and It
    works well with Firefox and IE 6. WHEN the screen setting is at 1024x768. But
    if I lower it to say...800x600 in IE it gets messed up, the drop-downs don't
    work. I was thinking if XML or XHTML(can't remember which) could help out.
    Thing is, I have no idea where to start looking on this matter. Here's the
    link, and I'll post the code too.

    [url]http://www.isminternet.com/danlopez/menu/template.htm[/url]

    The css page is called menu.css, so just type that in the address bar and
    you'll get access to it. Hope some one can help me out there!


    <!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 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];}
    }

    if(navigator.appName == "Netscape"){
    window.captureEvents(Event.MOUSEMOVE);
    }
    document.onmousemove = track;

    function track(e)
    {
    var x = (document.all) ? event.x : e.pageX;
    var y = (document.all) ? event.y : e.pageY;
    //for x coords use a javascript app inluded called menu2.htm to find them out.
    //Get X COORDS and plug two points
    //in the X<# || x>#. || stands for OR in javascript. The Y COORDS are for the
    length of the
    //drop-down menu, ajust this code to find the needs. It's all a game of
    numbers..
    if (x<140 || x>268 || y<0 || y>250)
    document.getElementById("menu_1").style.visibility = "hidden";
    if (x<265 || x>391 || y<0 || y>250)
    document.getElementById("menu_2").style.visibility = "hidden";
    if (x<390 || x>513 || y<0 || y>250)
    document.getElementById("menu_3").style.visibility = "hidden";
    if (x<510 || x>636 || y<0 || y>250)
    document.getElementById("menu_4").style.visibility = "hidden";
    if (x<636 || x>759 || y<0 || y>250)
    document.getElementById("menu_5").style.visibility = "hidden";
    if (x<760 || x>883 || y<0 || y>250)
    document.getElementById("menu_6").style.visibility = "hidden";
    }

    function reveal(menu){
    if(menu == 1) document.getElementById("menu_1").style.visibility = "visible";
    if(menu == 2) document.getElementById("menu_2").style.visibility = "visible";
    if(menu == 3) document.getElementById("menu_3").style.visibility = "visible";
    if(menu == 4) document.getElementById("menu_4").style.visibility = "visible";
    if(menu == 5) document.getElementById("menu_5").style.visibility = "visible";
    if(menu == 6) document.getElementById("menu_6").style.visibility = "visible";
    }
    //-->
    </script>
    </head>
    <link rel="stylesheet" href="menu.css" type="text/css">
    <body
    onLoad="MM_preloadImages('images/menu_01roll.gif','images/menu_02roll.gif','imag
    es/menu_03roll.gif','images/menu_04roll.gif','images/menu_05roll.gif','images/me
    nu_06roll.gif')">
    <div class="body" width="738px" align="center">
    <img src="images/photo1.jpg">
    </div>
    <div id="bar">
    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image8','','images/menu_01roll.gif',1);
    reveal(1)"><img src="images/menu_01.gif" name="Image8" width="121" height="34"
    border="0"></a>

    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image7','','images/menu_02roll.gif',1);
    reveal(2)"><img src="images/menu_02.gif" name="Image7" width="119" height="34"
    border="0"></a>
    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image9','','images/menu_03roll.gif',1);
    reveal(3)"><img src="images/menu_03.gif" name="Image9" width="119" height="34"
    border="0"></a>
    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image10','','images/menu_04roll.gif',1);
    reveal(4)"><img src="images/menu_04.gif" name="Image10" width="119" height="34"
    border="0"></a>
    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image11','','images/menu_05roll.gif',1);
    reveal(5)"><img src="images/menu_05.gif" name="Image11" width="119" height="34"
    border="0"></a>
    <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('Image12','','images/menu_06roll.gif',1);
    reveal(6)"><img src="images/menu_06.gif" name="Image12" width="121" height="34"
    border="0"></a>
    </div>
    <div id="menu_1" class="menu" style="left: 147px; width: 173px;">
    <a href=""> Main-Line Units </a><br/>
    <a href=""> Hose &amp; Drip Units </a><br/>

    <a href=""> Fertilizers &amp; Supplements</a><br/>
    <a href="">Parts &amp; Accessories</a>
    </div>
    <div id="menu_2" class="menu" style="left: 270px; width: 150px;">
    <a href=""> Main-Line Units </a><br/>

    <a href=""> Fertilize Responsibility </a><br/>
    <a href=""> Product Specs </a>
    </div>
    <div id="menu_3" class="menu" style="left: 393px; width: 124px;">
    <a href=""> Main-Line Units </a><br/>
    <a href=""> Hose &amp; Drip Units </a>

    </div>
    <div id="menu_4" class="menu" style="left: 516px; width: 155px;">
    <a href=""> Residential </a><br/>
    <a href=""> Commercial Properties </a><br/>
    <a href=""> Irrigation &amp; Landscape Contractors </a><br/>
    <a href=""> Distributors </a><br/>

    <a href=""> Vendors </a>
    </div>
    <div id="menu_5" class="menu" style="left: 639px; width: 140px;">
    <a href=""> Manangement </a><br/>
    <a href=""> Board of Directors </a><br/>
    <a href=""> Local &amp; Contact Info </a>

    </div>
    <div id="menu_6" class="menu" style="left: 762px; width: 150px;">
    <a href=""> Press Releases </a><br/>
    <a href=""> Trade Events </a><br/>
    <a href=""> Fertilize Responsibilty </a>
    </div>

    </body>

    </html>

    noobie2005 Guest

  2. Similar Questions and Discussions

    1. XML Flash dynamic menus
      i have an xml file which brings in <main title> and <sub text> info in. all works fine it all comes into a single dynamic text box no worries. ...
    2. Dynamic navigation menus
      CFGumby and mhowar2 , Thanks for the input. We decided to put this project on hold. I appreciate all the ideas you have given me. Thanks again...
    3. Dynamic jump menus
      I have a set of menus as following PARENT CHILD I made a recordset in ASP to populate the child menu list values based on the parent menu...
    4. Dynamic menus
      <?php include('./common_db.inc'); $link_id = db_connect(); mysql_select_db("test_db"); ?> <form name=carform action= <?php echo $_SERVER;...
    5. Help with Dynamic Navigation / Menus
      Hello, I am new to these forums. I'm looking for some help. I am working on a website redesign for the company I work for, and my boss wants...
  3. #2

    Default Re: div tag and dynamic menus

    > XML or XHTML(can't remember which)

    Here's a clue that it won't help you at all. Using a methodology when you
    don't even know which one to use is a sure way to dig your hole deeper.
    However, even if you knew that it was XHTML, it wouldn't help you a bit -
    XHTML is just a stricter version of HTML.

    Changing resolution does nothing other than to affect the maximum practical
    width you can set for your browser window. When I vary my browser window
    from about 950px width to about 400px width, I can see no such behavior in
    IE6. I have no idea why you are seeing that.

    Have you asked the author of that menu system why it would be sensitive to
    the width of the browser viewport?

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "noobie2005" <webforumsuser@macromedia.com> wrote in message
    news:d7s8oe$n1r$1@forums.macromedia.com...
    > Yeah, its me again. Looking for help. I have this menu that I created and
    > It
    > works well with Firefox and IE 6. WHEN the screen setting is at 1024x768.
    > But
    > if I lower it to say...800x600 in IE it gets messed up, the drop-downs
    > don't
    > work. I was thinking if XML or XHTML(can't remember which) could help out.
    > Thing is, I have no idea where to start looking on this matter. Here's the
    > link, and I'll post the code too.
    >
    > [url]http://www.isminternet.com/danlopez/menu/template.htm[/url]
    >
    > The css page is called menu.css, so just type that in the address bar and
    > you'll get access to it. Hope some one can help me out there!
    >
    >
    > <!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 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];}
    > }
    >
    > if(navigator.appName == "Netscape"){
    > window.captureEvents(Event.MOUSEMOVE);
    > }
    > document.onmousemove = track;
    >
    > function track(e)
    > {
    > var x = (document.all) ? event.x : e.pageX;
    > var y = (document.all) ? event.y : e.pageY;
    > //for x coords use a javascript app inluded called menu2.htm to find them
    > out.
    > //Get X COORDS and plug two points
    > //in the X<# || x>#. || stands for OR in javascript. The Y COORDS are for
    > the
    > length of the
    > //drop-down menu, ajust this code to find the needs. It's all a game of
    > numbers..
    > if (x<140 || x>268 || y<0 || y>250)
    > document.getElementById("menu_1").style.visibility = "hidden";
    > if (x<265 || x>391 || y<0 || y>250)
    > document.getElementById("menu_2").style.visibility = "hidden";
    > if (x<390 || x>513 || y<0 || y>250)
    > document.getElementById("menu_3").style.visibility = "hidden";
    > if (x<510 || x>636 || y<0 || y>250)
    > document.getElementById("menu_4").style.visibility = "hidden";
    > if (x<636 || x>759 || y<0 || y>250)
    > document.getElementById("menu_5").style.visibility = "hidden";
    > if (x<760 || x>883 || y<0 || y>250)
    > document.getElementById("menu_6").style.visibility = "hidden";
    > }
    >
    > function reveal(menu){
    > if(menu == 1) document.getElementById("menu_1").style.visibility =
    > "visible";
    > if(menu == 2) document.getElementById("menu_2").style.visibility =
    > "visible";
    > if(menu == 3) document.getElementById("menu_3").style.visibility =
    > "visible";
    > if(menu == 4) document.getElementById("menu_4").style.visibility =
    > "visible";
    > if(menu == 5) document.getElementById("menu_5").style.visibility =
    > "visible";
    > if(menu == 6) document.getElementById("menu_6").style.visibility =
    > "visible";
    > }
    > //-->
    > </script>
    > </head>
    > <link rel="stylesheet" href="menu.css" type="text/css">
    > <body
    > onLoad="MM_preloadImages('images/menu_01roll.gif','images/menu_02roll.gif','imag
    > es/menu_03roll.gif','images/menu_04roll.gif','images/menu_05roll.gif','images/me
    > nu_06roll.gif')">
    > <div class="body" width="738px" align="center">
    > <img src="images/photo1.jpg">
    > </div>
    > <div id="bar">
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image8','','images/menu_01roll.gif',1);
    > reveal(1)"><img src="images/menu_01.gif" name="Image8" width="121"
    > height="34"
    > border="0"></a>
    >
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image7','','images/menu_02roll.gif',1);
    > reveal(2)"><img src="images/menu_02.gif" name="Image7" width="119"
    > height="34"
    > border="0"></a>
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image9','','images/menu_03roll.gif',1);
    > reveal(3)"><img src="images/menu_03.gif" name="Image9" width="119"
    > height="34"
    > border="0"></a>
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image10','','images/menu_04roll.gif',1);
    > reveal(4)"><img src="images/menu_04.gif" name="Image10" width="119"
    > height="34"
    > border="0"></a>
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image11','','images/menu_05roll.gif',1);
    > reveal(5)"><img src="images/menu_05.gif" name="Image11" width="119"
    > height="34"
    > border="0"></a>
    > <a href="javascript://" onMouseOut="MM_swapImgRestore()"
    > onMouseOver="MM_swapImage('Image12','','images/menu_06roll.gif',1);
    > reveal(6)"><img src="images/menu_06.gif" name="Image12" width="121"
    > height="34"
    > border="0"></a>
    > </div>
    > <div id="menu_1" class="menu" style="left: 147px; width: 173px;">
    > <a href=""> Main-Line Units </a><br/>
    > <a href=""> Hose &amp; Drip Units </a><br/>
    >
    > <a href=""> Fertilizers &amp; Supplements</a><br/>
    > <a href="">Parts &amp; Accessories</a>
    > </div>
    > <div id="menu_2" class="menu" style="left: 270px; width: 150px;">
    > <a href=""> Main-Line Units </a><br/>
    >
    > <a href=""> Fertilize Responsibility </a><br/>
    > <a href=""> Product Specs </a>
    > </div>
    > <div id="menu_3" class="menu" style="left: 393px; width: 124px;">
    > <a href=""> Main-Line Units </a><br/>
    > <a href=""> Hose &amp; Drip Units </a>
    >
    > </div>
    > <div id="menu_4" class="menu" style="left: 516px; width: 155px;">
    > <a href=""> Residential </a><br/>
    > <a href=""> Commercial Properties </a><br/>
    > <a href=""> Irrigation &amp; Landscape Contractors </a><br/>
    > <a href=""> Distributors </a><br/>
    >
    > <a href=""> Vendors </a>
    > </div>
    > <div id="menu_5" class="menu" style="left: 639px; width: 140px;">
    > <a href=""> Manangement </a><br/>
    > <a href=""> Board of Directors </a><br/>
    > <a href=""> Local &amp; Contact Info </a>
    >
    > </div>
    > <div id="menu_6" class="menu" style="left: 762px; width: 150px;">
    > <a href=""> Press Releases </a><br/>
    > <a href=""> Trade Events </a><br/>
    > <a href=""> Fertilize Responsibilty </a>
    > </div>
    >
    > </body>
    >
    > </html>
    >

    Murray *TMM* Guest

  4. #3

    Default Re: div tag and dynamic menus

    > XHTML is just a stricter version of HTML.

    I'm sure that many a standards developer would rip your head off for saying
    such a thing ;)


    rob::db Guest

  5. #4

    Default Re: div tag and dynamic menus

    Heh.

    Let 'em. But it's true. All existing (valid) HTML tags and atributes are
    represented in XHTML1.

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "rob::db" <rob@digitalburn.net> wrote in message
    news:d81p3d$qlr$1@forums.macromedia.com...
    >> XHTML is just a stricter version of HTML.
    >
    > I'm sure that many a standards developer would rip your head off for
    > saying
    > such a thing ;)
    >
    >

    Murray *TMM* Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139