...

View Full Version : cross frames with js menu



crmpicco
03-14-2005, 12:35 PM
I am looking for a solution to allow me to cross frames with my existing code?

I have a menu bar at the top of my asp page:

<tr bordercolor="#AEBDE5">
<td width="128" align="center" style="border:1px solid #999999;cursor:hand;background-color:#003366;text-align:center" onclick="parent.main.location.href='airbook.asp';" onmouseover="fadeImgend2(0)" onmouseout="fadeImg2(0)"><font face="verdana" color="#FFFFFF" size=2>Flights</font></td>
<td width="128" align="center" style="border:1px solid #999999;cursor:hand;background-color:#003366;text-align:center" onclick="parent.main.location.href='bookings.asp';" onmouseover="fadeImgend2(1)" onmouseout="fadeImg2(1)"><font face="verdana" color="#FFFFFF" size=2>Bookings</font></td>
<td width="128" align="center" style="border:1px solid #999999;cursor:hand;background-color:#003366;text-align:center" onclick="parent.main.location.href='admin_login_form.asp';" onmouseover="fadeImgend2(2)" onmouseout="fadeImg2(2)"><font face="verdana" color="#FFFFFF" size=2>Admin</font></td>
<td width="129" align="center" style="border:1px solid #999999;cursor:hand;background-color:#003366;text-align:center" onclick="return dropdownmenu(this, event, menu2, '200px');" onmouseover="fadeImgend2(3)" onmouseout="fadeImg2(3);delayhidemenu();" target="_parent"><font color="#FFFFFF" size="2" face="verdana">Help</font></td>
<td width="129" align="center" style="border:1px solid #999999;cursor:hand;background-color:#003366;text-align:center" onclick="parent.location.href='logout.asp?logOut=true';" onmouseover="fadeImgend2(4)" onmouseout="fadeImg2(4)"><font face="verdana" color="#FFFFFF" size=2>Logout</font></td>
</tr>

My problem is when i click 'HELP' the javascript drop-down menu does not go into the next frame. it just cuts off.

how do i stop this? is there a parameter? or is it a new piece of code required?

Picco

_Aerospace_Eng_
03-14-2005, 03:04 PM
well one possible solution would be rather than using a frameset is to make a page with ur menu at the top, then below it add an iframe where ur links pages would appear, its the same behavior as a frameset but the js menu can cross over the iframe

vwphillips
03-14-2005, 03:23 PM
have a look at

http://www.vicsjavascripts.org.ok/FrameSubMenu/FrameSubMenu.htm

let me know if you want to go further with this, I may be able to assist depending on work load

or if you mount your frameset in an iframe you may be able to use the existing menu almost as is

see
http://www.vicsjavascripts.org.ok/HP/

brothercake
03-14-2005, 03:25 PM
if you mount your frameset in an iframe you may be able to use the existing menu almost as is
except that IE5.0 and Opera 7+ can't place content above an iframe, and Safari can't handle events in the region of an element which goes over an iframe (the events "fall through" and are handled by the iframe element)

I'd try to structure it as single pages, and avoid use of frames or iframes entirely.

crmpicco
03-14-2005, 04:05 PM
<html>

<head>
<title>Mackenzie Consol - empowered by Volaro</title>

</head>

<frameset rows="70,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0">
<frame name="navf" src="navframe.asp" SCROLLING="NO" MARGINWIDTH=0>
<frame name="main" src="airbook.asp">
<noframes>
<body bgcolor="#ececec">
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>

</html>

This page above shows my existing setup. Two frames. Two pages navframe.asp and airbook.asp. What do i need to change to allow cross-frame menus? Do i have to replace navframe.asp or more?

Picco

crmpicco
03-14-2005, 04:11 PM
[QUOTE=vwphillips]or if you mount your frameset in an iframe you may be able to use the existing menu almost as is
QUOTE]

how do i so this?

heres my code:

<html>

<head>
<title>Mackenzie Consol - empowered by Volaro</title>

</head>

<frameset rows="70,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0">
<frame name="navf" src="navframe.asp" SCROLLING="NO" MARGINWIDTH=0>
<frame name="main" src="airbook.asp">
<noframes>
<body bgcolor="#ececec">
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>

</html>

vwphillips
03-14-2005, 04:50 PM
I hope you have taken note of brothercake comments
and there are other ifs with this approach

I will have a go if I can get your menu to work but I will need the complete code

crmpicco
03-14-2005, 04:55 PM
heres my current pages:

a.htm:

_________

<html>
<head>
<title>Mackenzie Consol - empowered by Volaro</title>
</head>
<frameset rows="70,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0">
<frame name="navf" src="samples.html" SCROLLING="NO" MARGINWIDTH=0 style="z-index:inherit">
<frame name="main" src="airbook.asp">
<noframes>
<body bgcolor="#ececec">
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
______________

samples.html

<script language="javascript" src="webmenu.js"></script>
<script language="javascript" src="samples.js"></script>
<link rel="stylesheet" href="samples.css">
<script language="javascript">Main.Paint()</script>

___________________

samples.js

//--------------------------------------------------------------------------------------//
// WebMenu Genie generated code - (c) 2003 Webport Data
// Version 1.1.1
// Generated: 03/14/05 04:45:25 PM
//
// Please register this program by visiting http://www.webportdata.com
//--------------------------------------------------------------------------------------//

// Debug
window.onerror = ErrorHandler;
function ErrorHandler(msg, url, lno) {alert(msg + " : " + lno);}

wmPREFIX = "wm";
wmFONT = "Arial";
wmFONTSIZE = "12";
wmFONTALIGN = "right";
wmFORECOLOR = "#000000";
wmFOREOVER = "#FFFFFF";
wmFOREDOWN = "#FFFFFF";
wmFOREDIS = "#000000";
wmBACKCOLOR = "#D4D0C8";
wmBACKOVER = "#004080";
wmBACKDOWN = "#004080";
wmBACKDIS = "#FFFFFF";
wmMENUBACK = "#FFFFFF";
wmBORDWIDTH = 1;
wmCHECK = "images/check.gif";
wmCHECKOVER = "images/checkover.gif";
wmCHECKDOWN = "images/checkover.gif";
wmCHECKWIDTH = 16;
wmCHECKHEIGHT = 16;
wmARROW = "images/arrow.gif";
wmARROWOVER = "images/arrowover.gif";
wmARROWDOWN = "images/arrowover.gif";
wmARROWWIDTH = 9;
wmARROWHEIGHT = 9;
wmICON = "images/folder.gif";
wmICONOVER = "images/folderopen.gif";
wmICONDOWN = "images/folderopen.gif";
wmICONWIDTH = 16;
wmICONHEIGHT = 16;
wmVTOPOFFSET = 7;
wmVLEFTOFFSET = -5;
wmHTOPOFFSET = 1;
wmHLEFTOFFSET = 0;
wmTRANSITION = wmNONE;
wmTRANSSPEED = 0.50;
wmCURSOR = "default";

// Create Menu: Main
Main = new wmMenu("Main", wmMAIN, 10, 10, 450, 1, wmTEXT);
Main.cBorderClass = "wmBorder1";
Main.cTextClass = "wmText2";
Main.cFontAlign = "left";
Main.lFontBold = true;
Main.cBackColor = "#56ADD8";
Main.cBackOver = "#54C6FC";
Main.cBackDown = "#54C6FC";
Main.cForeOver = "#000000";
Main.cForeDown = "#000000";
Main.cMenuBack = "#56ADD8";
Main.nVTopOffset = 5;
Main.lTransparent = true;
I1 = Main.AddItem("I1", "FlightsA", "#000000", "#000000", "#000000", "#56ADD8", "#54C6FC", "#54C6FC");
I1.cHref = "airbook.asp";
I1.nWidth = 80;
I1.nPicWidth = 70;
I1.nPicHeight = 20;
I2 = Main.AddItem("I2", "Bookings");
I2.cHref = "bookings.asp";
I2.nWidth = 100;
I3 = Main.AddItem("I3", "Admin");
I3.cHref = "admin_login_form.asp";
I3.nWidth = 70;
I4 = Main.AddItem("I4", "Help");
I4.nWidth = 100;
I5 = Main.AddItem("I5", "Logout");
I5.cHref = "logout.asp?logOut=true";
I5.nWidth = 70;

// Create Menu: M4
M4 = I4.AddMenu("M4", 0, 1);
M4.cBorderClass = "wmBorder1";
M4.cTextClass = "wmText2";
M4.lFontBold = false;
M4.cBackColor = "#F8EA9A";
M4.cBackOver = "#004080";
M4.cBackDown = "#004080";
M4.cForeOver = "#FFFFFF";
M4.cForeDown = "#FFFFFF";
M4.cMenuBack = "#FFFFFF";
M4.lArrowCol = true;
M4.lTransparent = false;
M4.nOpacity = 100;
M4.nTransition = wmSCROLLDOWN;
I4_1 = M4.AddItem("I4_1", "Registration", "#000000", "#FFFFFF", "#FFFFFF", "#F8EA9A", "#004080", "#004080");
I4_1.cHref = "help.htm";
I4_2 = M4.AddItem("I4_2", "Agency Setup");
I4_2.cHref = "help.htm";
I4_5 = M4.AddItem("I4_5", "Staff User Names");
I4_5.cHref = "help.htm";
//--------------------------------------------------------------------------------------//
// End Webmenu Genie generated code
//--------------------------------------------------------------------------------------//
________________________________________

samples.css

.wmBorder1 {
border-width: 1px;
border-style: solid;
border-color: #000000;
}
.wmText2 {
font-family: Arial;
font-size: 12px;
}

____________________________

webmenu.js is massive!

are you going to take a look?

vwphillips
03-14-2005, 05:02 PM
The Z Index of the menu Items needs to be controlled so I need the COMPLETE code to see if this is possible

crmpicco
03-14-2005, 05:06 PM
webmenu.js is too big to post

vwphillips
03-14-2005, 05:15 PM
post a link to the url

ie MyURL/webmenu.js

presume that the other js will be on the same link

crmpicco
03-14-2005, 05:17 PM
http://www.freedownloadscenter.com/Reviews/r979.html

crmpicco
03-14-2005, 05:33 PM
*** Crossframe mode ***

Paste following code into <head> tag of page with top menu

<!-- Apycom DHTML Menu -->
<noscript>Visit <a href=http://dhtml-menu.com/>dhtml-menu.com</a> for more info.</noscript>
<script type="text/javascript" language="JavaScript1.2" src="yourdir/apymenu.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="yourdir/data.js"></script>
<!-- (c) 2004, Apycom Software, www.apycom.com -->

Be sure you have frameset "ID" and frame "NAME" properties in your frameset. Example:

<frameset id="fset" rows="130,*">
<frame id="frm1" name="frm1" src="topmenu.html">
<frame id="frm2" name="frm2" src="content.html">
</frameset>

Then replace the standard apy_init(); function at the end of data.js file by the apy_initFrame function:

apy_initFrame (framesetID, mainFrameInd, subFrameInd, orientation);

Where:
framesetID - id of <frameset> tag;
mainFrameInd - number of top menu frame (frame where the top menu will be placed) >=0;
subFrameInd - number of submenus' frame >=0;
orientation - 0 - horizontal frame orientation; 1 - vertical frame orientation.

Example, based on the previous frameset example:
apy_initFrame ("fset", 0, 1, 0);

That's all. Notice you DO NOT need to insert any additional code to pages in other frames!

vwphillips
03-14-2005, 05:39 PM
I am not downloading the menu generator

you will need to give me a link to the webmenu.js file



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum