
Extends the Element Type with some basic shortcuts (like .hide and .show).
Returns the state of the display of the element.
myElement.isDisplayed();
Determines if an element is displayed using offset height/width. If both of these are zero it usually means the element is not displayed or one of its parent's is not.
myElement.isVisible();
Toggles the state of an element from hidden (display = none) to visible (display = what it was previously or else display = block)
myElement.toggle();
Hides an element (display = none).
myElement.hide(); //same as $(id).setStyle('display', 'none');
Shows an element.
myElement.show(displayString);
$(id).show(); //same as $(id).setStyle('display', 'block'); $(id).show('inline'); //same as $(id).setStyle('display','inline');
Removes one class and adds the other. If the one to remove is not found the one to add is still added.
myElement.swapClass(removeClass, addClass);
$(id).swapClass('green', 'blue'); // removes green, adds blue
Removes any document selection (text selection). Can only be called on document.
document.clearSelection();
© Linux.ria.ua, 2008-2024 |