Closed beatgammit closed 13 years ago
i'd rather not break the existing interface since many people are use to it. However I think — as a completely separate utility (outside of Bonzo) there is merit in this.
I have a keen like for Closure's goog.dom.createDom
method which has the ability to pass in a dom reference to another (for nesting purposes).
Doing this outside of Bonzo also keeps this library lighter — and allows you to fully do it right in a separately maintained project.
Just an idea, how do you feel about a create function that accepts a properties?
Instead of MooTools' Element syntax, there could be something like this:
OR
I think that passing in this style of syntax really makes sense, and is more javascript-y than having to construct an HTML string.
My use case is canvas; reason being, canvas' height/width can't be changed on the fly, so they have to be recreated every time the width and height change (like on a mobile device when the orientation changes).
I like this syntax a lot better than the existing jQuery-style syntax. What do you think? Is there already a way to do this that I didn't notice?