JavaScript API
Change Object Visibility - changeObjectVisibility()
This function is also from Apple developer site (the copyright message allows it's use in other sites).
The function hides or shows a page element.
The Code
function changeObjectVisibility(objectId, newVisibility) {
var styleObject = getStyleObject(objectId, document);
if(styleObject) {
styleObject.visibility = newVisibility;
return true;
} else {
return false;
}
}
Example Usage
// show an element
changeObjectVisibility('myObjectId', 'visible');
// hide an element
changeObjectVisibility('myObjectId', 'hidden');
|