Such as:
in DynLayer constructor: this.styleClasses = [];
in child constructor: this._applyStyleClasses();
DynLayer.prototype._applyStyleClasses = function() // private
{
var str = "";
for (var i = 0; i < this.styleClasses.length; i++) {
if (i > 0) str += " ";
str += this.styleClasses[i];
}
this.elm.className = str;
};DynLayer.prototype.addStyleClass = function(cls)
{
this.styleClasses[this.styleClasses.length] = cls;
if (this.elm != null) {
this._applyStyleClasses();
}
};DynLayer.prototype.removeStyleClass = function(cls)
{
var classes = [];
for (var i = 0; i < this.styleClasses.length; i++) {
if (this.styleClasses[i] != cls) {
classes[classes.length] = this.styleClasses[i];
}
}
this.styleClasses = classes;
if (this.elm != null) {
this._applyStyleClasses();
}
};------------------- "The key to performance is elegance, not battalions of special cases." - Jon Bentley and Doug McIlroy
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/
