alright, i’m checking out the DOM (which has pretty cool methods)
so far i’ve got this: (its simplified)
[code=php]function mnu() {
var thismenu=name;
var mDiv = document.createElement(“div”);
mDiv.getVisibility=function() { thismenu.getVisibility(this); }
alert(mDiv.getVisibility());
document.body.appendChild(mDiv);
}
mnu.prototype.getVisibility=function(div) {
if (div.style.visibility==’none’ || div.style.visibility==’hidden’) {
return ‘hidden’;
}
else {
return ‘visible’;
}
}
so i attach a function to mDiv, which (should) returns visible or hidden, but it doesn’t, i get an [b]undefined
but when i put alert boxes in the function itself (in the if-clause), it gives me the correct values
can anybody help me?
grtz
edit: switched visible and hidden