Skip to content

Instantly share code, notes, and snippets.

@ayozebarrera
Last active August 29, 2015 13:56
Show Gist options
  • Save ayozebarrera/9058428 to your computer and use it in GitHub Desktop.
Save ayozebarrera/9058428 to your computer and use it in GitHub Desktop.
Avoid scroll-up when click in a link with href="#"
<script src="http://yui.yahooapis.com/3.12.0/build/yui/yui.js"></script>
<script>
YUI().use('node-base', 'node-event-delegate', function (Y) {
Y.one('body').delegate('click', function (e) {
e.preventDefault();
}, 'a[href="#"]');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment