navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Javascript and frames

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Javascript and frames
Page: [1]
 
puiwaihin

 

Posts: 1378
From: Taiwan
Status: offline

 
Javascript and frames - 3/15/2001 17:05:00   
I'm trying to get a script to create a hierarchial menu. The script works fine, but unfortunately it doesn't seem to be compatible with frames.

The menu appears but is cut off by the end of the frameset.

This part of the script goes in the <head> section:

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
layer = (document.all && No3) ? "document.all['L'+menu].style" : (document.layers && No3) ? "document.layers['L'+menu]" : 0;
var timer;

function Show() { if(layer) {
if(timer) clearTimeout(timer);
for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).visibility = "hidden"; } }
for(i=0; i<arguments.length; i++) { menu=arguments; eval(layer).visibility = "visible"; }
} }
function Hide() { timer = setTimeout("Show()", 500); }
//-->
</SCRIPT>

This part goes into the <Body> part of my HTML document:

<SCRIPT LANGUAGE="JavaScript">
<!--

//////////////////////////////////////////////////////

hovercolor = "#BBBBBB"; // color name/code
bgcolor = "#DDDDDD"; // color name/code
background = ""; // picture url

menu_border = 1; // IE only
border_color = "#000000"; // IE only

arrow_pic = "script740849_0_2.gif"; // url of arrow picture for submenus

//////////////////////////////////////////////////////


if(document.all) { if(!background) { background=bgcolor; } else { background = "url("+background+")"; } }

function LayerSpecs(Left,Top,Width) { if(No3) {
if(document.all) { Top+=7; Left+=2; Width-=6; }
this.left = Left;
this.top = Top;
this.info = "";
T=0;
for(i=3; i<arguments.length; i++) {
if(document.all) { this.info += "<TR><TD WIDTH="+Width+" onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\"\"'>"+arguments+"</TD></TR>"; }
else { this.info += "<LAYER onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\""+bgcolor+"\"' WIDTH="+Width+" POSITION=RELATIVE TOP="+T+"> "+arguments+"</LAYER>"; }
T+=20;
}
} }

Layer = new Array();
arrow = "<IMG SRC='"+arrow_pic+"' WIDTH=6 HEIGHT=10 BORDER=0 ALT=''>";


//////////////////////////////////////////////

/* Create Your layers below by typing:
Layer[incrementing number] = new LayerSpecs(Left Position, Top Position, Width, List of Links Seperated by Commas)
If a layer has a sublayer, add onMouseOver="Show(Layer Number to Open, Current Layer, Any Layers Opened before the current layer (seperated by commas)
*/

Layer[1] = new LayerSpecs(121,27,110,
'<A HREF="http://www.byu.edu" onMouseOver="Show(4,1)">Layer 1</A> '+arrow,
'<A HREF="http://www.javascripts.com" onMouseOver="Show(1)">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com" onMouseOver="Show(1)">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com" onMouseOver="Show(1)">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com" onMouseOver="Show(1)">Javascripts.com</A> '
);


(repeated code cut for brevity)


Layer[8] = new LayerSpecs(241,120,180,
'<A HREF="http://www.javascripts.com">Layer 8</A> ',
'<A HREF="http://www.javascripts.com">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com">Javascripts.com</A> ',
'<A HREF="http://www.javascripts.com">Javascripts.com</A> '
);


////////////////////////////////////////////////////////////////

j = (Layer[0]) ? 0:1;

for(i=j; i<Layer.length; i++) {
if(document.all && No3) { document.write("<SPAN onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' STYLE='position:absolute; visibility:hidden; background:"+background+"; top:"+Layer.top+"; left:"+Layer.left+";'><TABLE STYLE='border:solid "+menu_border+" "+border_color+"'>"+Layer.info+"</TABLE></SPAN>"); }
else if(document.layers && No3) { document.write("<LAYER onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+bgcolor+"' BACKGROUND='"+background+"' TOP="+Layer.top+" LEFT="+Layer.left+">"+Layer.info+"</LAYER>"); }
}

if(document.all) { document.all["menubar"].style.visibility = "visible"; }
else if(document.layers) { document.layers["menubar"].visibility = "visible"; }

// -->
</SCRIPT>


Can anyone help with this?


[This message has been edited by puiwaihin (edited 03-15-2001).]

Dixiedi

 

Posts: 130
From: Cincinnati
Status: offline

 
RE: Javascript and frames - 3/15/2001 18:41:00   
If you mean the bottom links on your menu do not show up, all you need to do is give your frame scrolling ability.

If you mean the fly out gets cut off on the side of the frame, there is nothing you cn do about it. The fly out part flies out on the page it is installed on. You have cut that page off with the frame.

Any hierachy type menu you use will have to be the kind that opens straight down.


(in reply to puiwaihin)
puiwaihin

 

Posts: 1378
From: Taiwan
Status: offline

 
RE: Javascript and frames - 3/15/2001 19:12:00   
That was the answer I didn't want, but thanks for answering me anyway =P

(in reply to puiwaihin)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Javascript and frames
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts