Web Hosting Talk







View Full Version : DHTML Menu Problems


mark1hos
09-10-2004, 05:09 PM
For our menu/navigation we use a DHTML menu which was created using some software. The problem is none of the page loads before the menu has finished building. Its rather slow.

Does anyone know how to make these faster or an alternative menu that allows sub-menus?

Thanks

Arcane
09-10-2004, 05:17 PM
Although you did buy the code, and you are entitled to it's source, you will have to post all, or part of the code. We cannot properly offer any suggestions without seeing what the problem is, or may be.

But, what the problem sounds like to me is:
1. The page is actually loading, it is just hidden behind an absolutely positioned block element, which is removed when the page finishes (i.e. onload attribute in the body start tag).
-or-
2. The ECMA source is very big. It takes a fair amount of time for the browser to parse and render the code. This surmounts to a lengthy waiting time. This is most likely the problem, but as I said, it's not possible to tell you without seeing anything.

mark1hos
09-10-2004, 05:23 PM
This partial code its in a file called filename.js and is run on the actual page by using the following:

<script type="text/javascript">function Go(){return}</script>
<script type="text/javascript" src="css/filename.js"></script>
<script type="text/javascript" src="css/menu9_com.js"></script>
<noscript></noscript>

/*
(c) Ger Versluis 2000 version 9.10 14 October 2002
You may use this script on non commercial sites.
For info write to menus@burmees.nl
You may remove all comments for faster loading*
*/

var NoOffFirstLineMenus=7;
var LowBgColor="#20549f";
var HighBgColor="white";
var FontLowColor="white";
var FontHighColor="#5da11a";
var BorderColor="white";
var BorderWidthMain=0;
var BorderWidthSub=1;
var BorderBtwnMain=1;
var BorderBtwnSub=1;
var FontFamily="Verdana";
var FontSize=8;
var FontBold=0;
var FontItalic=0;
var MenuTextCentered="center";
var MenuCentered="left";
var MenuVerticalCentered="top";
var ChildOverlap=.2;
var ChildVerticalOverlap=.2;
var StartTop=87;
var StartLeft=0;
var VerCorrect=5;
var HorCorrect=0;
var LeftPaddng=3;
var TopPaddng=3;
var FirstLineHorizontal=1;
var MenuFramesVertical=0;
var DissapearDelay=500;
var UnfoldDelay=0;
var TakeOverBgColor=1;
var FirstLineHorizontal=1;
var FirstLineFrame="";
var SecLineFrame="";
var DocTargetFrame="";
var TargetLoc="";
var MenuWrap=0;
var RightToLeft=0;
var BottomUp=0;
var UnfoldsOnClick=0;
var BaseHref="";
var Arrws=["i/arrow5.gif",15,8,"",10,5,"",5,10,"",10,5];
var MenuUsesFrames=0;
var RememberStatus=0;
var PartOfWindow=1;
var BuildOnDemand=1;
var MenuSlide="";
var MenuShadow="";
var MenuOpacity="";

function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){
if(ScLoc.HideArray){
var H_A,H_Al,H_El,i;
H_A=ScLoc.HideArray;
H_Al=H_A.length;
for (i=0;i<H_Al;i++){
H_El=(Nav4)?ScLoc.document.layers[H_A[i]]:(DomYes)?ScLoc.document.getElementById(H_A[i]).style:ScLoc.document.all[H_A[i]].style;
H_El.visibility=M_Hide}}
return}
function AfterCloseAll(){
if(ScLoc.HideArray){
var H_A,H_Al,H_El,i;
H_A=ScLoc.HideArray;
H_Al=H_A.length;
for (i=0;i<H_Al;i++){
H_El=(Nav4)?ScLoc.document.layers[H_A[i]]:(DomYes)?ScLoc.document.getElementById(H_A[i]).style:ScLoc.document.all[H_A[i]].style;
H_El.visibility=M_Show}}
return}


Menu1=new Array("rollover?i/menu/25.gif?i/menu/25.gif","index.htm","",2,20,25,"","","","","","",-1,-1,-1,"","");
Menu1_1=new Array("Home","index.htm","",0,20,130,"","","","","","",-1,1,-1,"left","");

Arcane
09-10-2004, 06:16 PM
(I realized the script is used on YOUR webpage)

The problem is, your script is located in the body of your document. As such, the top part of the page will load, and the bottom will be delayed until the menu has been created.
Because the actual script for the menu is so big (27KB), it may take a long time for a client to load it, thus delaying the load of the bottom part of the page.

This problem is not fixible at this stage, without major reconstruction. It is something that should have been considered when the design team created the algorithm for the script--which I highly assume was a skiped process in the creation of this menu script.

I only looked at this briefly. Give a try to putting both ot the external scripts in the HEAD of the document, only leaving the go() function call in the BODY.

sonicgroup
09-10-2004, 08:28 PM
Have you considered re-doing your menu? There's a solution that was presented initially on A List Apart, and then improved over at HTML Dog (http://www.htmldog.com/articles/suckerfish/dropdowns/).

It's all CSS based and is compliant across pretty much all browsers. It only contains 12 lines of JavaScript (for IE to recognize the :hover pseudo-element).

Stevor
09-10-2004, 09:44 PM
A flash menu is a good alternative, they are relatively easy to make and they load fast depending on the size, a nav one shouldnt slow down your site too much...

CyberWizard
09-11-2004, 12:23 AM
Go to:

http://milonic.com

I don't own the site or have anything to do with it but that's what I use cuz' I know alot of design stuff but come on.. Some things you just need to save time/money on.

mark1hos
09-11-2004, 06:16 AM
Originally posted by sonicgroup
Have you considered re-doing your menu? There's a solution that was presented initially on A List Apart, and then improved over at HTML Dog (http://www.htmldog.com/articles/suckerfish/dropdowns/).

It's all CSS based and is compliant across pretty much all browsers. It only contains 12 lines of JavaScript (for IE to recognize the :hover pseudo-element).

Would you be able to do it? If so, how much would you charge? We have 6 items across with only three of them with drop-downs of no more than 5 items.

Also anyone able to recommend someone who could do it in flash?

Thank you all for your help.