Hi,
I'm trying to implement a method that would allow to use
Class.create() inheriting HTML elements like div instead of other
classes. That is, the result would be something like this (the syntax
is arbitrary and is for demo purposes only):

var Block = Class.create("div", {
  initialize: function(bgColor) {
     this.style.backgroundColor = bgColor;
  },

 highlight: function() {
  ....
 },
});

var block = new Block("#aaaaff");
document.getElementById("mountPoint").appendChild(block);
block.highlight();

The purpose is to defeat the necessity to maintain two JS objects (the
actual DOM element and the object containing the special methods and
the DOM element) per entity.
Has anybody tried something like this? Can it be done without
modifying Prototype itself? Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to