summaryrefslogtreecommitdiff
path: root/web-ui/app/js/style_guide/main.js
diff options
context:
space:
mode:
authorGabriel Albo <gabriel@albo.com.br>2014-08-21 10:33:22 -0300
committerGabriel Albo <gabriel@albo.com.br>2014-08-21 10:33:31 -0300
commitd63d4b489af735651cee9d50357aa84106a19cd2 (patch)
tree9003f48df2a5b86eda583484794863058427327b /web-ui/app/js/style_guide/main.js
parentdc95cd401a814d19fcbb588f76ffdcc10aa4ec61 (diff)
Moving smooth transition js funtion to a specific style-guide js file
Diffstat (limited to 'web-ui/app/js/style_guide/main.js')
-rw-r--r--web-ui/app/js/style_guide/main.js16
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