Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:15

Menu loads extremely slow


Poster: Surfergirl
Dated: Tuesday August 10 2004 - 13:59:45 BST

Hi - its http://www.cw.tc - the menu drops long after the page is loaded. Does any one know why?

Here is the code:

<?php
include( "phpLib/ssn.php" );
include( "phpLib/std.php" );
include( "phpLib/usrs.php" );
include( "phpLib/lvCnt.php" );
include( "phpLib/meda.php" );
include( "phpLib/upld.php" );
include( "phpLib/pgCnt.php" );
$db = new cnnctn( 1, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'] );
$rlst = "";
$lvl1Lst = "";
$lvl2Lst = "";
$lvl3Lst = "";
$imageLnks = array( 1 => "image=http://www.cw.tc/images/nav/2.jpg;overimage=http://www.cw.tc/images/nav/2o.jpg;url=http://www.cw.tc/cnt.php?typ=main&c=1;",
2 => "image=http://www.cw.tc/images/nav/4.jpg;overimage=http://www.cw.tc/images/nav/4o.jpg;url=http://www.cw.tc/index.php;",
5 => "image=http://www.cw.tc/images/nav/3.jpg;overimage=http://www.cw.tc/images/nav/3o.jpg;url=http://www.cw.tc/index.php;",
6 => "image=http://www.cw.tc/images/nav/6.jpg;overimage=http://www.cw.tc/images/nav/6o.jpg;url=http://www.cw.tc/index.php;",
13 => "image=http://www.cw.tc/images/nav/5.jpg;overimage=http://www.cw.tc/images/nav/5o.jpg;url=http://www.cw.tc/index.php;" );
$sql = "SELECT schmID, mainTitle FROM menuSchems WHERE schmID IN(1,2,5,6,13) ORDER BY mainTitle";
$qry = mysql_query( $sql, $db->lnk );
$i = 0;
while( $row = mysql_fetch_array( $qry ) ) {
//make row items
$lvl2Lst = "";
$sql = "SELECT mnu, mainTitle FROM menuContent WHERE memberOf=0 AND schmID=" . (int)$row["schmID"] . " ORDER BY mainTitle";
$qry2 = mysql_query( $sql, $db->lnk );
$r = 0;
while( $row2 = mysql_fetch_array( $qry2 ) ) {
//sub items
$lvl3Lst = "";
/*$sql = "SELECT mnu, mainTitle FROM menuContent WHERE memberOf=" . (int)$row2["mnu"] . " ORDER BY mainTitle";
$qry3 = mysql_query( $sql, $db->lnk );
$s = 0;
while( $row3 = mysql_fetch_array( $qry3 ) ) {
//make sub items
$tmpDtas = new mnuDta( (int)$row3["mnu"], $db );
$lvl3Lst .= "aI(\"text=" . $tmpDtas->ttl . ";status=" . $tmpDtas->ttl . ";url=" . $tmpDtas->getLink() . ";\");\n";
$s++;
}
mysql_free_result( $qry3 );
if( strlen( $lvl3Lst ) > 0 ) {
$rlst .= "\nwith(milonic=new menuname(\"smnu" . (int)$row2["mnu"] . "\")){\nstyle=menuStyle;\n" . $lvl3Lst . "}\n\n";
}*/
//make sub items
$tmpDtar = new mnuDta( (int)$row2["mnu"], $db );
$showMnu = ( strlen( $lvl3Lst ) > 0 )? "showmenu=smnu" . (int)$row2["mnu"] . ";": "";
$lvl2Lst .= "aI(\"text=" . $tmpDtar->ttl . ";status=" . $tmpDtar->ttl . ";" . $showMnu . "url=" . $tmpDtar->getLink() . ";\");\n";
$r++;
}
mysql_free_result( $qry2 );
if( strlen( $lvl2Lst ) > 0 ) {
$rlst .= "\nwith(milonic=new menuname(\"rmnu" . (int)$row["schmID"] . "\")){\nstyle=menuStyle;\n" . $lvl2Lst . "}\n\n";
}
$tmpDtar = new mnuSchm( (int)$row["schmID"], $db );
$showMnu = ( strlen( $lvl2Lst ) > 0 )? "showmenu=rmnu" . (int)$row["schmID"] . ";": "";
$lvl1Lst .= "aI(\"" . $imageLnks[(int)$row["schmID"]] . "url=" . $imageLnks[(int)$row["schmID"]] . ";status=" . $tmpDtar->ttl . ";" . $showMnu . "\");\n";
$i++;
}
mysql_free_result( $qry );
if( strlen( $lvl1Lst ) > 0 ) {
$rlst .= "with( milonic = new menuname( \"MainMenu\" ) ) {\nstyle = homeStyle;\ntop = 60;\nleft = 0;\nalwaysvisible = 1;\n"
. "orientation = \"horizontal\";\naI(\"image=http://www.cw.tc/images/nav/1.jpg;overimage="
. "http://www.cw.tc/images/nav/1o.jpg;url=http://www.cw.tc/index.php;status=Back To Home "
. "Page;\");\n" . $lvl1Lst . "aI(\"image=http://www.cw.tc/images/nav/7.jpg;overimage="
. "http://www.cw.tc/images/nav/7o.jpg;url=http://www.tcimall.tc/;target=TCIMALL;status=Turks & "
. "Caicos Islands Online Mall;\");\n}\n";
}
$db->cllnk();
?>
//Define Menu information

_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_followSpeed=5 // Follow scrolling speed
_followRate=40 // Follow scrolling Rate
_subOffsetTop=7 // Sub menu top offset
_subOffsetLeft=10 // Sub menu left offset
_scrollAmount=3 // Only needed for Netscape 4.x
_scrollDelay=20 // Only needed for Netcsape 4.x

//define menu styles
with(menuStyle=new mm_style()){
onbgcolor="#FFDB4C";
oncolor="#362F14";
offbgcolor="#505050";
offcolor="#FFFFFF";
bordercolor="#666666";
borderstyle="solid";
borderwidth=1;
separatorcolor="#666666";
separatorsize="1";
padding=5;
fontsize="10px";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
subimage="../images/arrow.gif";
subimagepadding="2";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}

with(homeStyle=new mm_style()){
offbgcolor="#505050";
offcolor="#FFFFFF";
bordercolor="#4C8799";
borderstyle="solid";
borderwidth=0;
separatorcolor="#4C8799";
separatorsize="0";
padding=1;
fontsize="10px";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
subimage="";
subimagepadding="0";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}

//define menu objects
<?php print( $rlst ); ?>

//create menus
drawMenus();


Poster: marty
Dated: Tuesday August 10 2004 - 15:24:47 BST

Hi,

I think it may make a difference if you place these tags

Quote:
<SCRIPT language=JavaScript src="milonic/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=milonic/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=milonic/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.php" type=text/javascript></SCRIPT>


just after the <BODY> tag or in the <HEAD> of your document not right at the bottom of the html.


-Marty