Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic menu in Javascript

Status
Not open for further replies.

lordseck

IS-IT--Management
Joined
Jun 7, 2006
Messages
1
Location
US
Hi

I'm trying to alter some of the webpages in our corporate website. Basically, we have our main website, and then an order entry portion of our website that was designed by the folks who created the order entry software that does not match with our overall website.

To many a long story short, a particular part of the order entry site HAS to run in frames. Any attempt for me to transplant or alter the code forces it to stop working. So I had to cut up our main site layout (which is basically just table driven) and transplant it into this frameset. However, the topframe, which now contains the header of our site is having an issue with some of the javascript on the page. Basically, the bottom of the header contains buttons, some of which have popup menus as onmouseover fuctions.. but the popup menus will ONLY show in that frame - and since the next frame begins directly underneath the first frame, one cannot see the popup menus.

I'm not very well versed in javascript, so I was wondering if it was even possible to make some sort of dymanic popup menu that will ignore the frameset altogether and pop-up clearly.




This is the script code at the top of the html file


Code:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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>




This is the actual pop-up code in the page.


Code:
    <table border="0" cellpadding="0" cellspacing="0" width="142">
      <tr> 
        <td><img src="images/spacer.gif" width="142" height="1" border="0" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
      </tr>
      <tr> 
        <td><a href="[URL unfurl="true"]http://www.jkings.com/intro_kings.htm"[/URL] onMouseOut="MM_swapImgRestore();MM_showHideLayers('Layer1','','hide')" onMouseOver="MM_swapImage('Image8','','images/over-intro.gif',1);MM_showHideLayers('Layer1','','show')"><img src="images/FOLD-1_r1_c1.gif" name="Image8" width="142" height="26" border="0"></a></td>
        <td><img src="images/spacer.gif" width="1" height="26" border="0" alt=""></td>
      </tr>
      <tr> 
        <td><a href="[URL unfurl="true"]http://www.jkings.com/community.htm"[/URL] onMouseOut="MM_swapImgRestore();MM_showHideLayers('Layer1','','hide')" onMouseOver="MM_swapImage('Image9','','images/over-community.gif',1);MM_showHideLayers('Layer1','','show')"><img src="images/FOLD-1_r2_c1.gif" name="Image9" width="142" height="26" border="0"></a></td>
        <td><img src="images/spacer.gif" width="1" height="26" border="0" alt=""></td>
      </tr>
      <tr> 
        <td><a href="[URL unfurl="true"]http://www.jkings.com/food_safety.htm"[/URL] onMouseOut="MM_swapImgRestore();MM_showHideLayers('Layer1','','hide')" onMouseOver="MM_swapImage('Image10','','images/over-food.gif',1);MM_showHideLayers('Layer1','','show')"><img src="images/FOLD-1_r3_c1.gif" name="Image10" width="142" height="32" border="0"></a></td>
        <td><img src="images/spacer.gif" width="1" height="32" border="0" alt=""></td>
      </tr>
    </table>
  </div>
</div>
<div id="Layer2" style="position:absolute; left:113px; top:100px; width:100%; height:54px; z-index:2; visibility: hidden;"> 
  <div align="center">



    <table border="0" cellpadding="0" cellspacing="0" width="142">
      <tr> 
        <td><img src="images/spacer.gif" width="142" height="1" border="0" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
      </tr>
      <tr> 
        <td><a href="[URL unfurl="true"]http://www.jkings.com/news.htm"[/URL] onMouseOut="MM_swapImgRestore();MM_showHideLayers('Layer2','','hide')" onMouseOver="MM_swapImage('Image6','','images/over-articles.gif',1);MM_showHideLayers('Layer2','','show')"><img src="images/fold2_r1_c1.gif" name="Image6" width="142" height="26" border="0"></a></td>
        <td><img src="images/spacer.gif" width="1" height="26" border="0" alt=""></td>
      </tr>
      <tr> 
        <td><a href="[URL unfurl="true"]http://www.jkings.com/events.htm"[/URL] onMouseOut="MM_swapImgRestore();MM_showHideLayers('Layer2','','hide')" onMouseOver="MM_swapImage('Image7','','images/over-events1.gif',1);MM_showHideLayers('Layer2','','show')"><img src="images/fold2_r2_c1.gif" name="Image7" width="142" height="31" border="0"></a></td>
        <td><img src="images/spacer.gif" width="1" height="31" border="0" alt=""></td>
      </tr>
    </table>
 
Is this intErnet or intrAnet?
If this is an intranet app only the easiest thing might be to have every web page that calls the application use target="_blank" in the link so that the order entry system comes up in it's own window.

This may not suit your needs for reason currently unknown but I thought I would throw it out there. If the order entry system is a separate item it might be better, easier and less confusing to keep it separate.


It's hard to think outside the box when I'm trapped in a cubicle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top