Hello,
i have a javascript code written for IE and i want it to work for Netscape 7.2...
i have the code as
--------------------------
----------
----------
----------
-------
function doHilite() {
var e = window.event.srcElement;
if (e.className == "tun") {
e.className = "tover";
}
else if (e.className == "tover") {
e.className = "tun";
}
else if (e.className == "ph1") {
e.className = "pover1";
}
else if (e.className == "ph2") {
e.className = "pover2";
}
else if (e.className == "pover1") {
e.className = "ph1";
}
else if (e.className == "pover2") {
e.className = "ph2";
}
window.event.cancelBubble = true;
}
//changes the style of the selected tab to unselected and hide its text, then
//set the style of the tab that was clicked on to selected and show its text
function changeTab(eRow) {
var tabs = eRow.cells;
for (var i = 0; i < tabs.length; i++) {
var oldTab = tabs[i];
if (oldTab.className == "tsel") {
break;
}
}
oldTab.className = "tun";
var oldContent = getAssociated(oldTab);
oldContent.style.display = "none";
var newTab = window.event.srcElement;
newTab.className ="tsel";
var newContent = getAssociated(newTab);
newContent.style.display = "block";
window.event.cancelBubble = true;
}
//hide or show the text assoicated with the heading that was clicked
function hideShowGroup(e) {
var theGroup = e.children[0];
if (theGroup.style.display == "none") {
theGroup.style.display="bl
ock";
}
else {
theGroup.style.display="no
ne";
}
window.event.cancelBubble = true;
}
//returns the name of the element containing the text associated with each tab
function getAssociated(e) {
if (e.tagName == "TD") {
switch (e.id) {
case "DescTab":
return (Description);
case "SpatialTab":
return (Spatial);
case "AttribTab":
return (Attributes);
}
}
}
//centers the thumbnail
function position() {
var e;
e = document.all("thumbnail");
if (e != null) {
b = document.body;
w1 = b.clientWidth - 80;
w2 = w1 - thumbnail.width;
var margin = Math.floor(w2 * .5);
thumbnail.style.visibility
= "hidden";
thumbnail.style.marginLeft
= margin;
thumbnail.style.visibility
= "visible";
}
}
--------------------------
----------
----------
----------
----------
-This is related to event programming. as i am not aware of events in netscape,could u help to change this bit of piece of code to work for netscape.what are the changes to be made???
help me out...
Regards