Previous Thread
Next Thread
Print Thread
Rate Thread
#109835 12/10/2003 2:27 AM
Joined: Feb 2001
Posts: 2,285
Old Hand
Old Hand
Joined: Feb 2001
Posts: 2,285
Hey all,
I have a menu that is .js dropdown. I'd like to speed it up so that it load quicker and is less of a resource hog. Here is a sample:

Code
 function mmLoadMenus() {
if (window.mm_menu_0213144600_0) return;
window.mm_menu_0213144600_0 = new Menu("root",142,20,"Arial, Verdana, Helvetica, sans-serif",12,"#cccccc","#000000","#ff6600","#cccccc","center","middle",3,2,1000,0,0,true,true,true,0,false,false);
mm_menu_0213144600_0.addMenuItem("ADVOCACY","location='http://norcalcycling.com/advocacy/index.shtml'");
mm_menu_0213144600_0.fontWeight="bold";
mm_menu_0213144600_0.hideOnMouseOut=true;
mm_menu_0213144600_0.menuBorder=1;
mm_menu_0213144600_0.menuLiteBgColor='#ff9900';
mm_menu_0213144600_0.menuBorderBgColor='#000000';
mm_menu_0213144600_0.bgColor='#000000';
window.mm_menu_0213144344_1_1 = new Menu("LOCAL RIDING NEWS",142,20,"Arial, Verdana, Helvetica, sans-serif",12,"#cccccc","#000000","#ff6600","#cccccc","center","middle",3,2,1000,0,0,true,true,true,0,false,false);
mm_menu_0213144344_1_1.addMenuItem("NEWS ARCHIVE","location='http://norcalcycling.com/ridesandraces/archive.shtml'");
mm_menu_0213144344_1_1.fontWeight="bold";
mm_menu_0213144344_1_1.hideOnMouseOut=true;
mm_menu_0213144344_1_1.menuBorder=1;
mm_menu_0213144344_1_1.menuLiteBgColor='#ff9900';
mm_menu_0213144344_1_1.menuBorderBgColor='#000000';
mm_menu_0213144344_1_1.bgColor='#000000';
window.mm_menu_0213144344_1 = new Menu("root",142,20,"Arial, Verdana, Helvetica, sans-serif",12,"#cccccc","#000000","#ff6600","#cccccc","center","middle",3,2,1000,0,0,true,true,true,0,false,false);
mm_menu_0213144344_1.addMenuItem(mm_menu_0213144344_1_1,"location='http://norcalcycling.com/ridesandraces/index.shtml'");
mm_menu_0213144344_1.addMenuItem("EVENTS SCHEDULE","location='http://norcalcycling.com/ridesandraces/events.shtml'");
mm_menu_0213144344_1.addMenuItem("ON-ROAD RIDES","location='http://norcalcycling.com/ridesandraces/onroad.shtml'");
mm_menu_0213144344_1.addMenuItem("OFF-ROAD RIDES","location='http://norcalcycling.com/ridesandraces/offroad.shtml'");
mm_menu_0213144344_1.fontWeight="bold";
mm_menu_0213144344_1.hideOnMouseOut=true;
mm_menu_0213144344_1.childMenuIcon="http://norcalcycling.com/arrows.gif";
mm_menu_0213144344_1.menuBorder=1;
mm_menu_0213144344_1.menuLiteBgColor='#ff9900';
mm_menu_0213144344_1.menuBorderBgColor='#000000';
mm_menu_0213144344_1.bgColor='#000000';
as you can see, this code is repeated every time:
Code
      mm_menu_0213144344_1_1.fontWeight="bold";
mm_menu_0213144344_1_1.hideOnMouseOut=true;
mm_menu_0213144344_1_1.menuBorder=1;
mm_menu_0213144344_1_1.menuLiteBgColor='#ff9900';
mm_menu_0213144344_1_1.menuBorderBgColor='#000000';
mm_menu_0213144344_1_1.bgColor='#000000';
How can I have each link of the menu share one set of code? Some links also posess this as well:

Code
mm_menu_0213144344_1.childMenuIcon="http://norcalcycling.com/arrows.gif";  
Thanks for any and all help!

Sponsored Links
#109836 12/10/2003 10:45 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
have you tried using css for that?


- Allen wavey
- What Drives You?
#109837 12/10/2003 12:29 PM
Joined: Feb 2001
Posts: 2,285
Old Hand
Old Hand
Joined: Feb 2001
Posts: 2,285
I wouldn't know where to begin to use CSS for that. eek

laugh

Joined: Feb 2001
Posts: 2,285
Old Hand
Old Hand
Joined: Feb 2001
Posts: 2,285
smirk


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)