diff options
Diffstat (limited to 'web-ui/app/js/style_guide')
-rw-r--r-- | web-ui/app/js/style_guide/main.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web-ui/app/js/style_guide/main.js b/web-ui/app/js/style_guide/main.js new file mode 100644 index 00000000..d9092641 --- /dev/null +++ b/web-ui/app/js/style_guide/main.js @@ -0,0 +1,16 @@ +$(document).ready(function(){ + $('a[href*=#]').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') + && location.hostname == this.hostname) { + var $target = $(this.hash); + $target = $target.length && $target + || $('[name=' + this.hash.slice(1) +']'); + if ($target.length) { + var targetOffset = $target.offset().top; + $('html,body') + .animate({scrollTop: targetOffset}, 500); + return false; + } + } + }); +});
\ No newline at end of file |