Skip to content

Instantly share code, notes, and snippets.

@sapegin
Created July 13, 2012 06:24
Show Gist options
  • Save sapegin/3103107 to your computer and use it in GitHub Desktop.
Save sapegin/3103107 to your computer and use it in GitHub Desktop.
Controls helper
/**
* Controls
*
* <span data-trigger="slider-next" data-recipient=".portfolio">Next</span>
*/
$(document).click(function(e) {
var target = e.target;
if (target.getAttribute('data-trigger') && target.getAttribute('data-recipient')) {
target = $(target);
$(target.data('recipient')).trigger(target.data('trigger'));
e.preventDefault();
}
});
@sapegin
Copy link
Author

sapegin commented Jul 15, 2012

Но оба создают объект jQuery, который не создаётся в исходном варианте.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment