Kajtek
01 Apr 2006, 09:49 PM
Hey all -
I'm new to this forum and to web design.
I was hoping that somebody can help me out. I’m trying to control the width of a pull-down menu in Netscape and I think I found a script from a different website that may just do that, but I’m not familiar with Java. I was hoping somebody can look at the script below and explain what each line does.
I get the general idea of how it works and that I need to define css. Style “.pulldown” but I’m not sure what each line does and I don’t want to copy stuff I don’t need.
Any help is greatly appreciated.
Cheers. :)
. var t=0;
bagt=navigator.userAgent.toLowerCase();
bd=document;
bdom=(document.getElementById)?1:0;
bns=(bd.layers)?1:0;
bns6=(bdom&&navigator.appName=="Netscape");
bie=(bd.all); bwin=((bagt.indexOf("win")!=-1) || (bagt.indexOf("16bit")!=-1));
bmac=(bagt.indexOf("mac")!=-1);
if (bns && bwin){
bd.write("<style type=\'text/css\'>.pulldown {width: 148px;}</style>");
} else if (bns && bmac){
bd.write("<style type=\"text/css\">.pulldown {width: 95px;}</style>");
} else if (bns6 || (bie && bmac)){
bd.write("<style type=\'text/css\'>.pulldown {font-family:arial,verdana,sans-serif;font-size:11px;}</style>");
} else{
bd.write("<style type=\'text/css\'>");
bd.write(".pulldown {width: 138px;}");
bd.write("</style>");
}
I'm new to this forum and to web design.
I was hoping that somebody can help me out. I’m trying to control the width of a pull-down menu in Netscape and I think I found a script from a different website that may just do that, but I’m not familiar with Java. I was hoping somebody can look at the script below and explain what each line does.
I get the general idea of how it works and that I need to define css. Style “.pulldown” but I’m not sure what each line does and I don’t want to copy stuff I don’t need.
Any help is greatly appreciated.
Cheers. :)
. var t=0;
bagt=navigator.userAgent.toLowerCase();
bd=document;
bdom=(document.getElementById)?1:0;
bns=(bd.layers)?1:0;
bns6=(bdom&&navigator.appName=="Netscape");
bie=(bd.all); bwin=((bagt.indexOf("win")!=-1) || (bagt.indexOf("16bit")!=-1));
bmac=(bagt.indexOf("mac")!=-1);
if (bns && bwin){
bd.write("<style type=\'text/css\'>.pulldown {width: 148px;}</style>");
} else if (bns && bmac){
bd.write("<style type=\"text/css\">.pulldown {width: 95px;}</style>");
} else if (bns6 || (bie && bmac)){
bd.write("<style type=\'text/css\'>.pulldown {font-family:arial,verdana,sans-serif;font-size:11px;}</style>");
} else{
bd.write("<style type=\'text/css\'>");
bd.write(".pulldown {width: 138px;}");
bd.write("</style>");
}