Can anyone please help me? I need to add arrows to my JavaScript submenu to indicate that one of my submenu items have a child menu with options.
How can I do that in JavaScript without inserting graphics? I only need to show like a > greater than symbol or something like that.
11 2693
Post your current code, so that we can work with that.
Post your current code, so that we can work with that.
Hi Acoder and thanks for your quick reply,
Here is where I have each submenu defined: - if (!exclude) { //********
-
//************************
-
-
-
// *** POSITIONING AND STYLES *********************************************
-
-
-
var menuALIGN = "center"; // alignment
-
var absLEFT = 0; // absolute left or right position (if not center)
-
var absTOP = 128; // absolute top position
-
-
var staticMENU = false; // static positioning mode (ie5/6 and ns4 only)
-
-
var stretchMENU = false; // show empty cells
-
var showBORDERS = false; // show empty cell borders
-
-
var baseHREF = "resources/";
-
var zORDER = 1000; // base z-order of nav structure (not ns4)
-
-
var mCOLOR = "#339999"; // main nav cell color
-
var rCOLOR = "#006666"; // main nav cell rollover color
-
var keepLIT = true; // keep rollover color when browsing menu
-
var bSIZE = 1; // main nav border size
-
var bCOLOR = "#006666" // main nav border color
-
var aLINK = "#FFCC00"; // main nav link color
-
var aHOVER = "#FFFF99"; // main nav link hover-color (dual purpose)
-
var aDEC = "none"; // main nav link decoration
-
var fFONT = "Verdana,Tahoma,Helvetica"; // main nav font face
-
var fSIZE = 11; // main nav font size (pixels)
-
var fWEIGHT = "bold" // main nav font weight
-
var tINDENT = 7; // main nav text indent (if text is left or right aligned)
-
var vPADDING = 2; // main nav vertical cell padding
-
var vtOFFSET = 0; // main nav vertical text offset (+/- pixels from middle)
-
-
var vOFFSET = -5; // shift the submenus vertically
-
var hOFFSET = 4; // shift the submenus horizontally
-
-
var smCOLOR = "#339999"; // submenu cell color
-
var srCOLOR = "#006666"; // submenu cell rollover color
-
var sbSIZE = 1; // submenu border size
-
var sbCOLOR = "006666" // submenu border color
-
var saLINK = "#FFCC00"; // submenu link color
-
var saHOVER = "#FFFF99"; // submenu link hover-color (dual purpose)
-
var saDEC = "none"; // submenu link decoration
-
var sfFONT = "Verdana,Tahoma,Helvetica";// submenu font face
-
var sfSIZE = 11; // submenu font size (pixels)
-
var sfWEIGHT = "normal" // submenu font weight
-
var stINDENT = 5; // submenu text indent (if text is left or right aligned)
-
var svPADDING = 2; // submenu vertical cell padding
-
var svtOFFSET = 0; // submenu vertical text offset (+/- pixels from middle)
-
-
var shSIZE = 0; // menu drop shadow size
-
var shCOLOR = "#"; // menu drop shadow color
-
var shOPACITY = 75; // menu drop shadow opacity (not ie4/ns4/op5)
-
-
var keepSubLIT= true; // keep submenu rollover color when browsing child menu
-
var chvOFFSET = -3; // shift the child menus vertically
-
var chhOFFSET = -5; // shift the child menus horizontally
-
-
var closeTIMER = 330; // menu closing delay time
-
-
var cellCLICK = true; // links activate on TD click
-
var aCURSOR = "hand"; // cursor for active links (not ns4 or op5)
-
-
var altDISPLAY = "title"; // where to display alt text
-
var allowRESIZE=true; // allow resize/reload
-
-
-
//** LINKS ***********************************************************
-
-
-
// add main link item ("url","Link name",width,"text-alignment","_target","alt text",top position,left position,"key trigger")
-
addMainItem("index.htm","Home",65,"center","","home",0,0,"");
-
-
addMainItem("","Facts",65,"center","","",0,0,"");
-
-
defineSubmenuProperties(170,"left","left",0,0);
-
-
addSubmenuItem("general.htm","General info","","");
-
addSubmenuItem("quick.htm","A quick glance","","");
-
addSubmenuItem("curriculum.htm","curriculum","","");
-
// HERE IS WHERE I DEFINE THE CHILD MENU
-
defineChildmenuProperties(164,"left","center",0,0);
-
addChildmenuItem("http://www.example.com","Escuela Internacional","","");
-
-
// END OF FIRST CHILD MENU
-
-
addSubmenuItem("history.html","History","","");
-
addSubmenuItem("newsletter_latest.php","Read latest newsletter","","");
-
addSubmenuItem("newsletter_all.php","Read all newsletters","","");
-
addSubmenuItem("announcement_all.php","Read all announcements","","");
-
-
-
addMainItem("","Administration",110,"center","","",0,0,"");
-
-
defineSubmenuProperties(180,"left","left",0,0);
-
-
addSubmenuItem("staff2005.htm","Staff introduction 2005-2006","","");
-
addSubmenuItem("staff.htm","Staff introduction 2006-2007","","");
-
addSubmenuItem("directors.htm","Board of directors","","");
-
-
addMainItem("","Admission",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(150,"left","left",0,0);
-
-
addSubmenuItem("registration.htm","Policy and registration","","");
-
addSubmenuItem("fees.htm","Tuition and fees","","");
-
addSubmenuItem("forms.htm","Download forms","","");
-
addSubmenuItem("scholarship.htm","Scholarship","","");
-
-
addMainItem("","Associations",92,"center","","",0,0,"");
-
-
defineSubmenuProperties(170,"left","right",0,0);
-
-
addSubmenuItem("assoc.htm","PTA, SACS, Student Council","","");
-
-
addMainItem("","Calendar",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"center","left",0,0);
-
-
addSubmenuItem("calendar2006.htm","2006 - 2007","","");
-
addSubmenuItem("calendar2007.htm","2007 - 2008","","");
-
-
-
addMainItem("","Employment",92,"center","","",0,0,"");
-
-
defineSubmenuProperties(150,"left","left",0,0);
-
-
addSubmenuItem("opportunities.htm","opportunities","","");
-
addSubmenuItem("benefit.htm","teacher benefit package","","");
-
addSubmenuItem("application.asp","application","","");
-
addSubmenuItem("application.htm","job application form","","");
-
-
-
addMainItem("","Pictures",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"left","left",0,0);
-
-
addSubmenuItem("campus.htm","campus","","");
-
addSubmenuItem("activieties.htm","activities","","");
-
-
-
addMainItem("","Contact",80,"center","","",0,0,"");
-
-
defineSubmenuProperties(80,"right","left",0,0);
-
-
addSubmenuItem("contact.htm","contact info","","");
-
-
-
//**DO NOT EDIT THIS *****
-
}//***********************
-
//************************
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Hi Acoder,
What do you mean with >
Can you not just add it manually using >?
If not, you'll need to show the code for adding the sub menu.
Ok, let's see. I have this other program that works with the other one and this is where I define all of my functions. Is it this what you need? - var exclude=true; var agt=navigator.userAgent.toLowerCase();
-
var ie=false; var ie4=false; var ie5=false; var op5=false; var konqi=false;
-
if (document.all&&(agt.indexOf('msie')!=-1)) {
-
ie=true; ie4=true; exclude=false;
-
if (agt.indexOf('msie 4')==-1) { ie5=true; ie4=false; }
-
if (agt.indexOf('opera')!=-1) { ie=false; ie4=false; ie5=false; op5=true; }
-
}
-
var ns6=false; var mz7=false;
-
if (document.getElementById&&!ie) {
-
ns6=true; exclude=false;
-
if (agt.indexOf('netscape6')==-1) {
-
ns6=false; mz7=true;
-
}
-
if (window.opera) { mz7=false; op5=true;}
-
else if (agt.indexOf('gecko')==-1) { mz7=false; exclude=true; }
-
}
-
if (agt.indexOf('opera 4')!=-1) { op5=false; mz7=false; exclude=true; }
-
var ns4=false;
-
if ((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&!ie&&!op5&&!ns6&&!mz7) {
-
ns4=true; exclude=false;
-
}
-
if (agt.indexOf('webtv')!=-1) { ie=false; ie4=false; exclude=true; }
-
var win=true; var mac=false;
-
if (agt.indexOf('mac')!=-1) { win=false; mac=true; }
-
//djochange - added the following code to find Konqueror
-
if (navigator.vendor){
-
if (navigator.vendor =="KDE") {
-
ie=false;
-
ie4=false;
-
ie5=false;
-
konqi = true;
-
ns6=true;
-
ns4 = false;
-
exclude = false;
-
-
// exclude earlier than kde2.2
-
var thisKDE=agt;
-
var splitKDE=thisKDE.split("konqueror/");
-
var aKDE=splitKDE[1].split("; ");
-
var KDEn=parseFloat(aKDE[0]);
-
var oldKde=false;
-
if(KDEn<2.2){oldKde=true;exclude=true;ns6=false;konqi=false;}
-
}
-
}
-
//end djochange
-
// differentiate between opera 5 and 6
-
var op6=false;
-
if(op5){
-
if((agt.indexOf("opera 6")!=-1)||(agt.indexOf("opera/6")!=-1)){op6=true;op5=false;}
-
}
-
-
-
// array building functions for custom.js
-
var mu="mu";var m=0;var sm=0;var cm=0;var sp=0;
-
var mI=new Array;
-
var sP=new Array;
-
var sI=new Array;
-
var cP=new Array;
-
var cI=new Array;
-
-
function addMainItem(ma,mb,mc,md,me,mf,mg,mh,mi){
-
sm=0;
-
if(!mb||mb==""){mb=" ";}
-
while(mb.indexOf('<BR>')!=-1){mb=mb.replace('<BR>','<br>');}
-
if (!me||me==""){me="_self";}
-
if (!mf||mf==""||altDISPLAY==""){mf="none";}
-
if(!mg){mg=0;}if(!mh){mh=0;}
-
if(!mi||mi==""||mi=="c"||mi=="C"){mi="-";}
-
if(mi!="-"){mi=mi.toLowerCase();}
-
mI[m]=new Array(ma,mb,mc,md,me,mf,mg,mh,mi);
-
m++;
-
}
-
-
function defineSubmenuProperties(spa,spb,spc,spd,spe){
-
if(!spd){spd=0;}
-
if(!spe){spe=0;}
-
sP[(m-1)]=new Array(spa,spb,spc,spd,spe);
-
if (sm==0){
-
sI[(m-1)]=new Array; cP[(m-1)]=new Array; cI[(m-1)]=new Array;
-
}
-
}
-
-
function addSubmenuItem(sma,smb,smc,smd){
-
cm=0;var sme=true;
-
if(sme&&sma=="~"){sme=false;sma="";}
-
if (!sma||sma==""){sma="#";}
-
if (!smb||smb==""){smb=" ";}
-
while(smb.indexOf('<BR>')!=-1){smb=smb.replace('<BR>','<br>');}
-
if (!smc||smc==""){smc="_self";}
-
if (!smd||smd==""||altDISPLAY==""){smd="none";}
-
sI[(m-1)][sm]=new Array(sma,smb,smc,smd,sme);
-
sm++;
-
}
-
-
function defineChildmenuProperties(cpa,cpb,cpc,cpd,cpe){
-
if(!cpd){cpd=0;}
-
if(!cpe){cpe=0;}
-
cP[(m-1)][(sm-1)]=new Array(cpa,cpb,cpc,cpd,cpe);
-
cI[(m-1)][(sm-1)]=new Array;
-
}
-
-
function addChildmenuItem(cma,cmb,cmc,cmd){
-
var cme=true;
-
if(cma&&cma=="~"){cme=false;cma="";}
-
if (!cma||cma==""){cma="#";}
-
if (!cmb||cmb==""){cmb=" ";}
-
while(cmb.indexOf('<BR>')!=-1){cmb=cmb.replace('<BR>','<br>');}
-
if (!cmc||cmc==""){cmc="_self";}
-
if (!cmd||cmd==""||altDISPLAY==""){cmd="none";}
-
cI[(m-1)][(sm-1)][cm]=new Array(cma,cmb,cmc,cmd,cme);
-
cm++;
-
}
-
// custom upgrade backup definitions
-
var keepSubLIT=true;var chvOFFSET=0;var chhOFFSET=-5;var closeTIMER=330;var cellCLICK=true;var aCURSOR="hand";
-
var altDISPLAY="";var allowRESIZE=true;
OH MY GOOD,
Nobody can help?
Hi Acoder,
What do you mean with >
> is a HTML character entity for "greater than" or > (see link).
Hi Acoder,
I try the $gt; but when I upload the program I can only see two options of my menu and I can't see the others.
This is where I place the option: - addSubmenuItem("registration.htm","Policy and Registration &gt;","","");
So do you get an error? If so, what's the error?
Please use code tags when posting code:
[CODE=javascript]
JavaScript code here.
[/code]
Hi again Acoder,
Is working now, I think I did something wrong.
Now what I'd like to know is how can I make this > go at the end.
For example, if I have a submenu like this:
Vision >
I need the symbol to be at the end, having all the spaces in between the word Vision and the symbol. Do I need to add spaces? How can I do that?
You could add spaces using but you probably wouldn't be able to align it correctly. You're better off right-aligning it while the text is left-aligned. You could use tables or CSS.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Benoit |
last post by:
Here is a quick view of what my program is doing:
I am using a system hook to add a menu inside the system menu of my
Internet Explorer. Everything seems to work fine for now , my submenu
is...
|
by: Stefan |
last post by:
I'd like to display the keyboard navigation indicators in my C#
application without the user having to press the Alt key and regardless
of the machines global setting (Hide keyboard navigation...
|
by: jeff.perreault |
last post by:
I have a problem with a skmMenu submenu and I think it has to do with
an IIS Setting.
I have the same website set up on two servers -
One is MS 2003, the other is MS 2003 R2
If I load the web...
|
by: Jonathan |
last post by:
Hello All,
I am in the process of creating a 2/3 level collapsible/exspanible menu
(called "nav") where users can click on a category and have the
submenus appear beneath it and so on (allow...
|
by: Denburt |
last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
|
by: az538 |
last post by:
Hello All,
I am having a problem with my menu and submenu system. It works like a champ in IE6 and Firefox but IE7 renders the submenus in incorrect positions on the page. Also, the menu system...
|
by: jobs |
last post by:
On the asp.net 2.0 menu control under vs 2005.
Any way to remove that black arrow on menu items that have a submenu?
Any way to equally size menu items dispite text site of menu item?
Thanks...
|
by: bhosalevivek |
last post by:
I did this code from Dynamic Drive DHTML. it's working properly, but now I need submenu for "Submenu 1.2", means when I take mouse on "Submenu 1.2" I need to display "Submenu 1.2.1". I try to do...
|
by: oll3i |
last post by:
i have written css tab menu
but my links in submenu inherit the style of a href in main menu (#menu ul li a)?
when i hover over the links in submenu they do change as i want them to change they...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |