by munificent · 15y ago · 0 comments
document.querySelector('#menu').appendChild(sliderMenu.node);
If you have suggestions for improvement, please do pass them along. $('#menu').append(sliderMenu); document.query('#menu').nodes.add(sliderMenu.node);
Is a reflection of that. The ".node" part after sliderMenu will go away at some point. Our DOM lib doesn't currently work like jQuery's "collection-that-acts-like-an-object" style because we're worried about performance.Keep in mind that you can always ditch jQuery and go straight to the DOM if jQuery is too slow. If jQuery was the only way, you'd lose your fast path.
So we've tried to come up with a DOM API that's easier to use, but still performant. If you've got ideas for how we can improve it, we'd definitely like to hear them.
#menu.add(.sliderMenu)
e.g. #,., maybe % or _ before elements, and you have a much more fluent syntax.