Last active
August 29, 2015 13:56
-
-
Save ayozebarrera/9058428 to your computer and use it in GitHub Desktop.
Avoid scroll-up when click in a link with href="#"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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