Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
K. Thomas #1
Multiple declarations of fwLoadMenus
I am having an issue with declaring multiple fwLoadMenus. I have a template
that declares a set of menus that every page uses, but I would also like to add
additional menus to other objects that would be page specific. A simplified
version of the code looks as follows:
[q]
<!-- Static content. These menus are used on every page -->
function fwLoadMenus() {
if (window.fw_menu_1) return;
window.fw_menu_1 = new Menu("root",128,17,"Arial, Helvetica,
sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
fw_menu_1.addMenuItem("X","location='X'");
fw_menu_1.addMenuItem("X","location='X'");
fw_menu_1.addMenuItem("X","location='X'");
fw_menu_1.hideOnMouseOut=true;
if (window.fw_menu_0) return;
window.fw_menu_0 = new Menu("root",115,17,"Arial, Helvetica,
sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
fw_menu_0.addMenuItem("X","location='X'");
fw_menu_0.addMenuItem("X","location='X'");
fw_menu_0.addMenuItem("X","location='X'");
fw_menu_0.hideOnMouseOut=true;
fw_menu_0.writeMenus();
fw_menu_1.writeMenus();
} // fwLoadMenus()
<script language=JavaScript src="fw_menu1.js"></script>
<!-- Page specific content. -->
<script language=JavaScript>
function fwLoadMenus2() {
if (window.fw_menu_3) return;
window.fw_menu_3 = new Menu("root",128,17,"Arial, Helvetica,
sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
fw_menu_3.addMenuItem("X","location ='X'");
fw_menu_3.addMenuItem("X","location ='X'");
fw_menu_3.addMenuItem("X","location ='X'");
fw_menu_3.hideOnMouseOut=true;
fw_menu_3.writeMenus();}
</script>
<script language=JavaScript src="fw_menu1.js"></script>
Much later on..
<script language=JavaScript>fwLoadMenus();</script >
<script language=JavaScript>fwLoadMenus2();</script >
And further on..
<A onmouseover="window.FW_showMenu(window.fw_menu_1,3 74,50)" href="#">
...
<a onMouseOver="window.FW_showMenu(window.fw_menu_3,6 30,90)" href="#">
[/q]
As you can see, there are two separate declarations for two menus and the
names do not interfer. When the page loads, only the static set of menus
(menu1, menu0) appear. The other set (menu3) acts as though it was never
initialized. Is there a problem with having two function calls that generate
menu items?
Ideally, Id like to just add an editable region inside the <script> region
where the first set of menus is declared, but Dreamweaver 8 and previous
versions refuse to recognize such tags as viable locations. Were it possible,
then I could just append my third menu. Is there a simple work around to make a
<script> editable (short of injecting code via another script) or is it easier
to get two fwLoadMenus to co-exist?
Appreciate the help.
K. Thomas Guest
-
#39524 [Opn->Fbk]: Class declarations may not be nested
ID: 39524 Updated by: tony2001@php.net Reported By: depish at gmail dot com -Status: Open +Status: ... -
#39524 [NEW]: Class declarations may not be nested
From: depish at gmail dot com Operating system: Win XP PHP version: 5.2.0 PHP Bug Type: *Compile Issues Bug description: ... -
namespace declarations in LibXML
Hi, I am using LibXML to create an xml document. I am also using namespaces. The problem that i am running into is that the document that i am... -
handling class declarations generated by proxy
Hi, i have some common classes that i pass from my client app through the web services to my server side app. I have their assembly referenced in... -
[PHP-DEV] superglobals inside of function declarations
Hello, I've been using PHP for quite a while now and i'm getting interested it's internal beheaviour. I'm wondering why it isn't possible to use... -
Murray *ACE* #2
Re: Multiple declarations of fwLoadMenus
Please read what the author of these menus (he adapted them from code
produced originally by Netscape) has to say about them -
[url]http://www.losingfight.com/blog/2006/08/11/the-sordid-tale-of-mm_menufw_menujs/[/url]
Do you really want to use them?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"K. Thomas" <webforumsuser@macromedia.com> wrote in message
news:enjeu5$8ec$1@forums.macromedia.com...>I am having an issue with declaring multiple fwLoadMenus. I have a template
> that declares a set of menus that every page uses, but I would also like
> to add
> additional menus to other objects that would be page specific. A
> simplified
> version of the code looks as follows:
>
> [q]
>
> <!-- Static content. These menus are used on every page -->
> function fwLoadMenus() {
>
> if (window.fw_menu_1) return;
> window.fw_menu_1 = new Menu("root",128,17,"Arial, Helvetica,
> sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
>
> fw_menu_1.addMenuItem("X","location='X'");
> fw_menu_1.addMenuItem("X","location='X'");
> fw_menu_1.addMenuItem("X","location='X'");
> fw_menu_1.hideOnMouseOut=true;
>
> if (window.fw_menu_0) return;
> window.fw_menu_0 = new Menu("root",115,17,"Arial, Helvetica,
> sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
>
> fw_menu_0.addMenuItem("X","location='X'");
> fw_menu_0.addMenuItem("X","location='X'");
> fw_menu_0.addMenuItem("X","location='X'");
> fw_menu_0.hideOnMouseOut=true;
>
> fw_menu_0.writeMenus();
> fw_menu_1.writeMenus();
>
> } // fwLoadMenus()
>
> <script language=JavaScript src="fw_menu1.js"></script>
>
> <!-- Page specific content. -->
>
> <script language=JavaScript>
> function fwLoadMenus2() {
>
> if (window.fw_menu_3) return;
>
> window.fw_menu_3 = new Menu("root",128,17,"Arial, Helvetica,
> sans-serif",11,"#3366ff","#cc6600","#ffffff","#ffffff") ;
> fw_menu_3.addMenuItem("X","location ='X'");
> fw_menu_3.addMenuItem("X","location ='X'");
> fw_menu_3.addMenuItem("X","location ='X'");
> fw_menu_3.hideOnMouseOut=true;
>
> fw_menu_3.writeMenus();}
> </script>
> <script language=JavaScript src="fw_menu1.js"></script>
>
>
> Much later on..
>
> <script language=JavaScript>fwLoadMenus();</script >
> <script language=JavaScript>fwLoadMenus2();</script >
>
> And further on..
>
> <A onmouseover="window.FW_showMenu(window.fw_menu_1,3 74,50)" href="#">
> ...
> <a onMouseOver="window.FW_showMenu(window.fw_menu_3,6 30,90)" href="#">
> [/q]
>
> As you can see, there are two separate declarations for two menus and the
> names do not interfer. When the page loads, only the static set of menus
> (menu1, menu0) appear. The other set (menu3) acts as though it was never
> initialized. Is there a problem with having two function calls that
> generate
> menu items?
>
> Ideally, Id like to just add an editable region inside the <script> region
> where the first set of menus is declared, but Dreamweaver 8 and previous
> versions refuse to recognize such tags as viable locations. Were it
> possible,
> then I could just append my third menu. Is there a simple work around to
> make a
> <script> editable (short of injecting code via another script) or is it
> easier
> to get two fwLoadMenus to co-exist?
>
> Appreciate the help.
>
Murray *ACE* Guest



Reply With Quote

