dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Menu Population

  1. #1
    Join Date
    Aug 2009
    Posts
    4

    Angry Menu Population

    I have a menu that has 2 tabs hard coded with the drop down links. The rest are supposed to auto populate using an Array but fail to do so. looking for some help!

    Script for header links

    <div id="DDIntranet" class="dropmenudiv_a">
    <a href="/dd/iframe/Default.php" target="iDD">Operations - Current Report</a>
    <a href="/dd/iframe/AddXML.php" target="iDD">Operations - Insert eLog</a>
    <!--<a href="javascript:void(0);" rel="DDOperations">Operations - Weather Forecast</a>
    <a href="javascript:void(0);" rel="DDOperations">Operations - GeoRadial Search</a>
    <a href="/Maintenance/default.htm" target="new">Maintenance/Repair</a>-->
    <!--<a href="javascriptopSuppliesAll()">Supplies</a>-->
    <a href="/dd/iframe/Supplies.php" target="iDD">Operations - Supplies</a>
    <a href="/Operations/weather.htm" target="new">Operations - Weather</a>
    <a href="/dd/iframe/CrewChange.php" target="iDD">Personnel - Crew Change</a>
    <a href="/dd/iframe/CrewMembers/CrewMembers.php" target="iDD">Personnel - Manage Crew</a>
    <!--<a href="/Sales/default.htm">Sales</a>
    <a href="/Admin/Default.htm">Admin</a>-->
    </div>

    <div id="DDOperations" class="dropmenudiv_a">
    <a href="javascript:void(0);">Current Report</a>
    </div>

    <div id="DDChristie" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDBobby" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDJuan" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDTammy" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDCaitlin" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDPaul" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDKayd" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDMyrtle" class="dropmenudiv_a"><a href="void();">DummyLink</a></div>
    <div id="DDMap" class="dropmenudiv_a">
    <a href="javascriptageChangeHandler()">Toggle Map Rotation</a>
    <a href="javascript:showweather(1);">Montco GeoDisplay</a>
    <a href="javascript:showweather(3);">Buoy Weather</a>
    <a href="javascript:showweather(2);">LSU Wavesys</a>
    <a href="javascript:CenterMap()">Default Zoom</a>
    <a href="javascript:SetOpacity()">Block Opacity</a>
    <a href="javascriptopDistance()">Distance Tool</a>
    </div>



    onload function which is called on this "<body onload="LoadPage()" scroll=no>" and is supposed to populate the vessels!


    function LoadPage() {
    SetMapSize();
    window.onresize = SetMapSize;

    map = new VEMap('Map');
    map.SetDashboardSize(VEDashboardSize.Tiny);
    map.LoadMap();
    map.AttachEvent("oninitmode", MapModeChanged);
    map.SetMapStyle('h');


    PlotBoats();
    map.AttachEvent("onmousemove", MouseMove);
    CenterMap();
    map.AddShapeLayer(slDrawing);
    }


    <!--Dropdown Creation Code-->
    divlist = new Array("DDKayd","DDMyrtle","DDPaul","DDCaitlin","DDJuan","DDTammy","DDBobby","DDChristie");
    <?
    For ($x=0;$x<6;$x++){
    list($area,$block,$plat) = parseLoc($Goods[$x][7]);
    ?>
    var lat = "";
    var lng = "";
    var area = "<?=$area?>";
    var block = "<?=$block?>";
    var lat = <?=$Goods[$x][8]?>;
    var lng = <?=$Goods[$x][9]?>;
    var label = "<?=trim($Goods[$x][0])?>";
    var indexbox = "";

    var DropDownHTML = "<a href=\"javascriptopSDWin(" + lat + "," + lng + ",'" + label + "');\">Operations - SoilData</a>";
    DropDownHTML += "<a href=\"javascriptopSiteWin(" + lat + "," + lng + ",'" + label + "');\">Operations - SiteHistory</a>";
    DropDownHTML += "<a href=\"javascriptopPipeWin(" + lat + "," + lng + ",'" + label + "');\">Operations - Pipelines </a>";
    DropDownHTML += "<a href=\"http://buoyweather.com/wxnav6.jsp?region=GC&program=nww3BW1&grb=wna&zone=-5&units=e&latitude=" + lat + "&longitude=" + lng + "\" target=\"new\">Operations - Wave Forecast</a>";
    DropDownHTML += "<a href=\"/dd/iframe/AddXML.php?Vessel=<?=trim($Goods[$x][0])?>\" target=\"iDD\">Operations - Insert eLog</a>";
    //DropDownHTML += "<a href=\"javascriptopPipeAreaWin('" + area + "','" + block + "');\">Pipelines (from block)</a>";
    //DropDownHTML +="<a href=\"javascriptopSupplies('" + label + "');\">Supplies</a>";
    DropDownHTML +="<a href='/dd/iframe/CrewChange.php?Vessel=" +label+ "' target=\"iDD\">Personnel - Crew Change</a>";
    document.getElementById(divlist[<?=$x?>]).innerHTML = DropDownHTML;
    <?} ?>

    var pages=new Array();
    pages[1]="Map";
    pages[2]="lsu";
    pages[3]="buoy";


    var i=1;
    var time=10000; // this is set in milliseconds
    var pagechanging = "";

  2. #2
    Join Date
    Apr 2007
    Posts
    425

    Re: Menu Population

    So where's the Java question?
    ------
    If you are satisfied with the responses, add to the user's rep!

  3. #3
    Join Date
    May 2009
    Location
    Lincs, UK
    Posts
    298

    Re: Menu Population

    ...and when you move your question to the appropriate forum (one about JavaScript, not Java) please add [CODE] tags to make your code readable.

  4. #4
    Join Date
    Aug 2009
    Posts
    4

    Red face Re: Menu Population

    Sorry thought thats where i did post it. I am very new to javascript and got thrown to the wolves on this one. but i will post it on the javascript page.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)