Skip to content

Instantly share code, notes, and snippets.

@hugoware
Created December 6, 2011 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugoware/1439173 to your computer and use it in GitHub Desktop.
Save hugoware/1439173 to your computer and use it in GitHub Desktop.
//
// wires up an object of selectors
//
// var ui = {
// menu: "#main-menu",
// list: "#list .item",
// options: {
// yes: "#option-yes",
// no: "#option-no"
// }
//
// };
$.connect = function(target) {
$.each(target, function(key, value) {
if (typeof value == 'object') $.connect(value)
else target[key] = $(value);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment