Feature suggestion: relative wrapped set

Feature suggestion: relative wrapped set


Sometimes we need to build relaitons between two sets of elements. For
example, a bunch of buttons will cause a bunch of menus to slide. In
such case, we will have to register event listener for each of them.
what if we can write the code like this:
$({
"#button1": "#menu1",
"#button2": "#menu2,#menu3"
"#button3, #button4": "#menu4,#menu5"
}.click(function(slave) {
var button=this;
var menu=slave;
button.toggleClass("clicked");
menu.slideToggle("slow");
});
with the single statement executed, we have the relations between the
buttons and the menus as follow:
button1 will cause menu1 to slide.
button2 will cause menu2 and menu3 to slide at the same time.
both buttton3 and button4 will cause menu4 and menu5 to slide at the
same time.
There may be some potential problems, though.
i don't know how to call the returned wrapped set, and i'll call it
the "relative wrapped set" for the moment. Hope u don't mind.
So, do u think it is possible to write code like this?