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:32

Compression error


Poster: sa}{en
Dated: Sunday September 18 2005 - 18:25:51 BST

I've tried to compress my menu_data.js with your online compressor.

http://www.milonic.com/jscompactor.php

When trying the compressed version the menu will not work. is this a common error? My file is quite big, so it would be nice with a little compression.


Poster: Ruth
Dated: Sunday September 18 2005 - 19:09:49 BST

Hi,

I just tried using the compressor and found that when I just copied and pasted the output to a file and saved it, the menu using that file works fine, but when I clicked the link to download the .js file and used that file, I got errors and the menu wouldn't show.

Ruth

Still have trouble


Poster: sa}{en
Dated: Monday September 19 2005 - 8:25:28 BST

The file will still not work. Would I need some special editor when pasteing? I just use notepad, and thought it would work fine.

The file i try to compress is:
http://www.elefun.no/webshop/js2/menu_data.js

You see the menu at http://www.elefun.no

By the way. Is there other ways to make it faster or smaller to load. It's quite big right now.


Poster: Ruth
Dated: Monday September 19 2005 - 16:13:34 BST

Try removing all the top stuff that isn't usually in the menu_data.js file. Begin the file with _menuCloseDelay=500; Then after it's compressed, paste the other stuff back into it. I just tested your page and that seemed to work.

Ruth

Thank you


Poster: sa}{en
Dated: Monday September 19 2005 - 18:36:23 BST

Thank you. It worked fine now. But it didn't help much. Is there another way to compress more or to make the file smaler? Would it help haveing the menu_data in more files or something like that?


Poster: Ruth
Dated: Tuesday September 20 2005 - 0:58:48 BST

There's not much you can do since it contains so much. Even if you split it, you still have the same amount, just in different files. One thing you can do is make sure you eliminate all the lines you have slashed out. The ones with // in front of them. You can remove the copyright since that is in the program files. And, you can use the copyOf method for your styles.

In place of the visstistyle put this
Code:
visstistyle=new copyOf(mainstyletopp);
visstistyle.oncolor="#000000";
visstistyle.offcolor="#000000";
since, both that style and the mainstyletopp only have two items different.

In place of the menuStyle2 and menuStyletopp you can put these
Code:
menuStyle2=new copyOf(menuStyle);
menuStyle2.offbgcolor="#85c3ea";
menuStyle2.pagebgcolor="#ff0000";
menuStyle2.pageimage="";

menuStyleTopp=new copyOf(menuStyle);
menuStyleTopp.itemwidth="";
menuStyleTopp.onbgcolor="#77beec";
menuStyleTopp.oncolor="#000000";
menuStyleTopp.offbgcolor="transparent";
menuStyleTopp.subimage="arrow.gif";
menuStyleTopp.subimagepadding=3;
menuStyleTopp.image="../js2/blank.gif";
menuStyleTopp.imagepadding=3;
menuStyleTopp.menubgimage="../js2/topp_bak.gif";
menuStyleTopp.padding=4;
menuStyleTopp.separatoralign="right";
menuStyleTopp.separatorcolor="#C5C2B8";
menuStyleTopp.separatorpadding=1;
menuStyleTopp.separatorwidth="80%";
menuStyleTopp.menubgcolor="#ffffff";
menuStyleTopp.pagebgcolor="#C1D2EE";
menuStyleTopp.onborder="2px solid #e7f6fd";
menuStyleTopp.overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#999999, Direction=135, Strength=5)";       
I'm pretty sure they are correct, but you need to check the menuStyle from which they take their copyOf since you have two pagebgcolors listed in it. That cut another 1kb off the regular file size, before compression so it was 39kb, don't know what it would be after compression. Every kb helps.

Hope that helps.

Ruth