S
Simba
Hi,
I've written some javascript routines for Internet Explorer and Opera.
Could you tell me the Netscape and Mozilla equivalents?
Thanks
-------------------------
//this works with Opera, not with Netscape and Mozilla:
var menuOpened = false;
var whatMenu = new Object();
function showMenu(menu){ //menu is the id of a DIV element
if ( menu == null ) return;
if (!menuOpened){
menu.style.visibility='visible';
menuOpened = true;
whatMenu = menu;
}
else{
menu.style.visibility='hidden';
menuOpened = false;
whatMenu = null;
}
}
-----------------
//this works only with Internet Explorer and Opera
var clicksBold = 0;
function toggleBold(){
clicksBold++;
SPANs = document.all.tags("SPAN");
for (var h = 0; h < SPANs.length; h++){
x = SPANs[h];
if (x.className == "aClassName"){
if ((clicksBold % 2) == 1) x.style.fontWeight = "bold";
else x.style.fontWeight = "normal";
}
}
}
-----------------
colors = new Array("blue","cyan","lightgreen","green","red","orange","yellow","pink","violet","black","gray","white");
for (var j = 0; j < colors.length; j++){
document.write("<span style='background-color:" + colors[j] + ";
height:25; width:25; border-style:solid; border-width:1pt'></span> ");
}
//the output is a series of sqares in Internet Explorer and Opera,
some black lines in Netscape
--------------------------
//anID is the ID of a SPAN element
<select name="leftMargin"
onchange="anID.style.marginLeft=this.value;">
....
</select>
I've written some javascript routines for Internet Explorer and Opera.
Could you tell me the Netscape and Mozilla equivalents?
Thanks
-------------------------
//this works with Opera, not with Netscape and Mozilla:
var menuOpened = false;
var whatMenu = new Object();
function showMenu(menu){ //menu is the id of a DIV element
if ( menu == null ) return;
if (!menuOpened){
menu.style.visibility='visible';
menuOpened = true;
whatMenu = menu;
}
else{
menu.style.visibility='hidden';
menuOpened = false;
whatMenu = null;
}
}
-----------------
//this works only with Internet Explorer and Opera
var clicksBold = 0;
function toggleBold(){
clicksBold++;
SPANs = document.all.tags("SPAN");
for (var h = 0; h < SPANs.length; h++){
x = SPANs[h];
if (x.className == "aClassName"){
if ((clicksBold % 2) == 1) x.style.fontWeight = "bold";
else x.style.fontWeight = "normal";
}
}
}
-----------------
colors = new Array("blue","cyan","lightgreen","green","red","orange","yellow","pink","violet","black","gray","white");
for (var j = 0; j < colors.length; j++){
document.write("<span style='background-color:" + colors[j] + ";
height:25; width:25; border-style:solid; border-width:1pt'></span> ");
}
//the output is a series of sqares in Internet Explorer and Opera,
some black lines in Netscape
--------------------------
//anID is the ID of a SPAN element
<select name="leftMargin"
onchange="anID.style.marginLeft=this.value;">
....
</select>