I've tried to compress my menu_data.js with your online compressor.
http://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.
Compression error
Still have trouble
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.
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.
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 since, both that style and the mainstyletopp only have two items different.
In place of the menuStyle2 and menuStyletopp you can put these 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
In place of the visstistyle put this
Code: Select all
visstistyle=new copyOf(mainstyletopp);
visstistyle.oncolor="#000000";
visstistyle.offcolor="#000000";
In place of the menuStyle2 and menuStyletopp you can put these
Code: Select all
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)";
Hope that helps.
Ruth