DHTML Menu Builder font size trick

User 2176570 Photo


Guest
1 post

I wanted to use a different size fonts in the main layer from the sublayers so a added a bit of code:
(the lines marked NMK is my addition)

In the main variables, a counter:
var WebMasterCheck=0; // menu tree checking on or off 1 or 0
var ShowArrow=0; // Uses arrow gifs when 1
var KeepHilite=1; // Keep selected path highligthed
var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height
var SizeCount=0; // Counter for submenu resizing - NMK


/***********************************************************************
DO NOT EDIT ANYTHING BELOW THIS LINE - IT WILL BREAK THE SCRIPT !
***********************************************************************/


And in the script, an if-statement which redefines the font size:
else{ if(Nav4) var MmbrCntnr=new Layer(Wdth,Location)
else{
WMnu+='c';
Location.document.body.insertAdjacentHTML("AfterBegin","<div id='"+WMnu+"' style='visibility:hidden; position:absolute;'><\/div>");
var MmbrCntnr=Location.document.all[WMnu]}}
MmbrCntnr.SetUp=CntnrSetUp;
if (SizeCount>0){ // Added for resizing - NMK
FontSize=12; // Added for resizing - NMK
} // Added for resizing - NMK
SizeCount++; // Added for resizing - NMK
MmbrCntnr.SetUp(Wdth,Hght,NumberOf);
if(Exp4){ MmbrCntnr.InnerString='';
for(i=1;i<NumberOf+1;i++){
WMnu=MName+eval(i);
MmbrCntnr.InnerString+="<div id='"+WMnu+"' style='position:absolute;'><\/div>"}


Hope some might find this helpful.

NB: The code can easily be edited to allow for several different font sizes. Each menu-block is a count.
User 122279 Photo


Senior Advisor
14,450 posts

Thanks for posting this. I'm sure that users of the DHTML menu maker will find it useful. I'll copy your post to the DHTML menu maker's forum.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.