Skip to content

Instantly share code, notes, and snippets.

@mytholog
Created January 16, 2013 10:30
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 mytholog/4546210 to your computer and use it in GitHub Desktop.
Save mytholog/4546210 to your computer and use it in GitHub Desktop.
jQuery UI auto widgets
$("[data-role]").each(function () {
var self = $(this);
self[self.data("role")](self.data("options"));
});
//example: <a href='#' data-role='button' data-options='{"icons":{"primary":"ui-icon-plus"}}'>Click me</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment