Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Load menu from onClick event
ras
Junior Member

Posts: 2
Registered: 11/26/2003
Member Is Offline
posted on 11/26/2003 at 02:47 PM Reply With Quote
Load menu from onClick event


I'd like to be able to launch a menu from OnClick event associated with an image in an anchor. Is this possible?
View User's Profile View All Posts By User U2U Member
ras
Junior Member

Posts: 2
Registered: 11/26/2003
Member Is Offline
posted on 11/26/2003 at 02:51 PM Reply With Quote

Or make the menu invisible until I need it...
View User's Profile View All Posts By User U2U Member
BigJ
Newbie

Posts: 1
Registered: 2/13/2004
Member Is Offline
posted on 2/13/2004 at 07:12 PM Reply With Quote

add the following two functions to the menu.js file:

// --------------------------------------------------------------------------------
function show_menu(menu_id){
// hide the menu if it is visible
if(A_MENUS[menu_id].a_children[0].e_oelement.style.visibility == 'visible'){
hide_menu(menu_id);
return;
}
// hide any other elements
for (var i = 0; i < A_MENUS.length; i++){
if(i != menu_id) hide_menu(i);
}
// make root level visible
for (var n_order = 0; n_order < A_MENUS[menu_id].a_children.length; n_order++)
A_MENUS[menu_id].a_children[n_order].e_oelement.style.visibility = 'visible';
}

// --------------------------------------------------------------------------------
function hide_menu(menu_id){
// make root level invisible
for (var n_order = 0; n_order < A_MENUS[menu_id].a_children.length; n_order++)
A_MENUS[menu_id].a_children[n_order].e_oelement.style.visibility = 'hidden';
}


then for your onClick event call:

onClick="show_menu(0)"

for whatever item you set this event to, it will cause it to open the menu on the first click, and close it on the second click

if you have multiple menus, 0 is the first menu loaded, 1 the second, etc. The function will close any open menus when opening a different one.

finally, you need to change the following line in the 'menu' function:

// make root level visible
for (var n_order = 0; n_order < this.a_children.length; n_order++)
this.a_children[n_order].e_oelement.style.visibility = 'visible';

to read:

// make root level invisible
for (var n_order = 0; n_order < this.a_children.length; n_order++)
this.a_children[n_order].e_oelement.style.visibility = 'hidden';

hint: the line is at the end of the function in menu.js
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Tigra Menu
Product Demonstrations Live Demos:
Traditional Blue
White Steps
Inner HTML
All Together
Frames Targeting
Free Download Free Download
Free Download Menu Builders
Online Builder
Builder for Windows
Product Documentation Documentation:
Documenation Page
Change Log
Menus Comparison Table
Support Forum Support Forum
 
Tigra Menu PRO
Product Demonstrations Live Demos
Alignment & Multimenus
Unlimited Depth
Item sizing and positioning
Inner HTML
Frames, Targeting
Static Positioning
Free Download Menu Builders
Online Builder
Product Documentation Documentation
Documenation Page
Tigra Menu PRO FAQ
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 
Product Page Tigra Menu GOLD
Functionality demos Functionality demos
Multiple
Cross-framed
Select-boxes
Effects
Design demos Design demos
Icons & arrows
Idea!
Hi there!
Matrix
MS Style
XP Style
Dots
3D-Buttons
Product Documentation Documentation
Documenation Page
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004